1

final cleanup

This commit is contained in:
2022-07-24 23:13:12 +02:00
parent f711e41216
commit d04f4495ae
10 changed files with 26 additions and 10 deletions

View File

@ -6,7 +6,7 @@ void PCSPKdemo::run() {
kout << "Playing..." << endl;
kout.unlock();
(pcspk.*melody)(); // This syntax is confusing as hell
(*melody)(); // This syntax is confusing as hell
kout.lock();
kout << "Finished" << endl;

View File

@ -6,12 +6,12 @@
class PCSPKdemo : public Thread {
private:
void (PCSPK::*melody)(); // Allow to pass a melody to play when initializing the demo
void (*melody)(); // Allow to pass a melody to play when initializing the demo
public:
PCSPKdemo(const PCSPKdemo& copy) = delete;
explicit PCSPKdemo(void (PCSPK::*melody)()) : Thread("PCSPKdemo"), melody(melody) {}
PCSPKdemo(void (*melody)()) : Thread("PCSPKdemo"), melody(melody) {}
~PCSPKdemo() override {
PCSPK::off();

View File

@ -14,8 +14,10 @@ private:
static int is_transmit_empty();
public:
SerialOut(const SerialOut& copy) = delete;
SerialOut();
SerialOut(const SerialOut& copy) = delete;
// Can't make singleton because atexit
static char read();
static void write(char a);