From e9c5a558724721cfdfa1120d28389dfcd7064092 Mon Sep 17 00:00:00 2001 From: R0ck Date: Sat, 17 Oct 2026 23:27:43 +0100 Subject: [PATCH] Remove the acknowledgement tones --- variants/t1000-e/T1000eBoard.cpp | 24 ++---------------------- variants/t1000-e/T1000eBoard.h | 1 - 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/variants/t1000-e/T1000eBoard.cpp b/variants/t1000-e/T1000eBoard.cpp index 9bdeff89c..649ae9d64 100644 --- a/variants/t1000-e/T1000eBoard.cpp +++ b/variants/t1000-e/T1000eBoard.cpp @@ -3,10 +3,6 @@ #include "T1000eBoard.h" -#ifdef PIN_BUZZER_EN - #include -#endif - void T1000eBoard::begin() { NRF52BoardDCDC::begin(); btn_prev_state = HIGH; @@ -36,13 +32,6 @@ void T1000eBoard::attachDynamicPrefs(KeyValueStore* prefs) { #endif } -#ifdef PIN_BUZZER_EN -static void playTune(const char* tune) { - if (rtttl::isPlaying()) rtttl::stop(); - rtttl::begin(PIN_BUZZER, tune); -} -#endif - void T1000eBoard::setBuzzerEnabled(bool enable) { #ifdef PIN_BUZZER_EN _buzzer_muted = !enable; @@ -53,11 +42,6 @@ void T1000eBoard::setBuzzerEnabled(bool enable) { void T1000eBoard::loop() { NRF52BoardDCDC::loop(); #ifdef PIN_BUZZER_EN - if (!rtttl::done()) rtttl::play(); - if (_buzzer_mute_pending && rtttl::done()) { // mute once the confirmation beep has finished - _buzzer_mute_pending = false; - setBuzzerEnabled(false); - } if (_buzzer_muted) digitalWrite(PIN_BUZZER_EN, LOW); // keep it off even if the UI re-enables it #endif } @@ -65,7 +49,7 @@ void T1000eBoard::loop() { bool T1000eBoard::handleCommand(const char* command, uint32_t sender_timestamp, char* reply) { #ifdef PIN_BUZZER_EN if (strcmp(command, "get buzzer") == 0) { - sprintf(reply, "> %s", (_buzzer_muted || _buzzer_mute_pending) ? "off" : "on"); + sprintf(reply, "> %s", _buzzer_muted ? "off" : "on"); return true; } if (memcmp(command, "set buzzer ", 11) == 0) { @@ -73,18 +57,14 @@ bool T1000eBoard::handleCommand(const char* command, uint32_t sender_timestamp, if (_prefs && !_prefs->setByKey("buzzer", "1")) { strcpy(reply, "Error: failed to save buzzer setting"); } else { - _buzzer_mute_pending = false; setBuzzerEnabled(true); - playTune("MsgRcv3:d=4,o=6,b=200:32e,32g,32b,16c7"); // same tune as a new message strcpy(reply, "OK - buzzer on"); } } else if (strcmp(&command[11], "off") == 0) { if (_prefs && !_prefs->setByKey("buzzer", "0")) { strcpy(reply, "Error: failed to save buzzer setting"); } else { - setBuzzerEnabled(true); - _buzzer_mute_pending = true; - playTune("ack:d=32,o=8,b=120:c"); // same beep as an ack, before going quiet + setBuzzerEnabled(false); strcpy(reply, "OK - buzzer off"); } } else { diff --git a/variants/t1000-e/T1000eBoard.h b/variants/t1000-e/T1000eBoard.h index 846c7df2e..e6ceb4fec 100644 --- a/variants/t1000-e/T1000eBoard.h +++ b/variants/t1000-e/T1000eBoard.h @@ -9,7 +9,6 @@ protected: uint8_t btn_prev_state; KeyValueStore* _prefs = NULL; bool _buzzer_muted = false; - bool _buzzer_mute_pending = false; void setBuzzerEnabled(bool enable);