From 0d8fa629ba2ba932c5993524edd0d5eaf81f219d Mon Sep 17 00:00:00 2001 From: Alco van Neck Date: Sat, 28 Feb 2026 19:52:22 +0100 Subject: [PATCH] Refactor: move buzzer RTTTL strings to class members, tune sounds, add PlatformIO build task --- .vscode/tasks.json | 18 ++++++++++++++++++ src/helpers/ui/buzzer.h | 8 ++++++++ 2 files changed, 26 insertions(+) create mode 100644 .vscode/tasks.json diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..e6d8240c --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,18 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "PlatformIO Build", + "type": "shell", + "command": "platformio", + "args": [ + "run" + ], + "isBackground": false, + "problemMatcher": [ + "$platformio" + ], + "group": "build" + } + ] +} \ No newline at end of file diff --git a/src/helpers/ui/buzzer.h b/src/helpers/ui/buzzer.h index 0a500552..df2c9013 100644 --- a/src/helpers/ui/buzzer.h +++ b/src/helpers/ui/buzzer.h @@ -28,6 +28,14 @@ class genericBuzzer void quiet(bool buzzer_state); // enables or disables the buzzer bool isQuiet(); // get buzzer state on/off + + // Example RTTTL melodies for startup/shutdown/message/discovery + const char *startup_song = "Startup:d=4,o=5,b=160:16c6,16e6,8g6"; + const char *shutdown_song = "Shutdown:d=4,o=5,b=100:8g5,16e5,16c5"; + const char *message_song = "MsgRcv3:d=4,o=6,b=200:32e,32g,32b,16c7"; + const char *discovery_song = "Discovery:d=4,o=5,b=180:8e6,8d6,8c6"; + const char *channel_song = "kerplop:d=16,o=6,b=120:32g#,16c#"; // more of a "plop" sound for channel change + const char *ack_song = "ack:d=16,o=8,b=120:c8,c6"; // Two beeps: first high (C8), then low (C6) private: // gemini's picks: const char *startup_song = "Startup:d=4,o=5,b=160:16c6,16e6,8g6";