* refactored buzzer concept to UITask

* moved buzzer.h/cpp to helpers/ui
This commit is contained in:
Scott Powell
2025-05-20 11:52:55 +10:00
parent 4a60548b7d
commit 7e90d386e2
7 changed files with 35 additions and 26 deletions

View File

@@ -53,6 +53,18 @@ void UITask::begin(DisplayDriver* display, NodePrefs* node_prefs, const char* bu
// v1.2.3 (1 Jan 2025)
sprintf(_version_info, "%s (%s)", version, build_date);
#ifdef PIN_BUZZER
buzzer.begin();
#endif
}
void UITask::soundBuzzer() {
#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
}
void UITask::msgRead(int msgcount) {
@@ -248,6 +260,10 @@ void UITask::loop() {
buttonHandler();
userLedHandler();
#ifdef PIN_BUZZER
if (buzzer.isPlaying()) buzzer.loop();
#endif
if (_display != NULL && _display->isOn()) {
static bool _firstBoot = true;
if(_firstBoot && millis() >= BOOT_SCREEN_MILLIS) {