initial support for generic RTTTL notifier

This commit is contained in:
seagull9000 2025-05-20 13:26:40 +12:00
parent f9c0056955
commit be88bea42d
4 changed files with 112 additions and 1 deletions

View file

@ -66,6 +66,11 @@
static UITask ui_task(&board);
#endif
#ifdef PIN_BUZZER
#include "buzzer.h"
genericBuzzer buzzer;
#endif
// Believe it or not, this std C function is busted on some platforms!
static uint32_t _atoi(const char* sp) {
uint32_t n = 0;
@ -484,7 +489,12 @@ class MyMesh : public BaseChatMesh {
}
void soundBuzzer() {
// TODO
#if defined(PIN_BUZZER)
// gemini's pick
buzzer.play("MsgRcv3:d=4,o=6,b=200:32e,32g,32b,16c7");
//Serial.println("DBG: Buzzzzzz");
#endif
}
protected:
@ -1553,6 +1563,10 @@ public:
ui_task.setHasConnection(_serial->isConnected());
ui_task.loop();
#endif
#ifdef PIN_BUZZER
if (buzzer.isPlaying()) buzzer.loop();
#endif
}
};
@ -1620,6 +1634,10 @@ void setup() {
board.begin();
#ifdef PIN_BUZZER
buzzer.begin();
#endif
#ifdef DISPLAY_CLASS
DisplayDriver* disp = NULL;
if (display.begin()) {