Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/buzz/buzz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ struct ToneDuration {
#define NOTE_G6 1568
#define NOTE_E7 2637

#define NOTE_C4 262
#define NOTE_E4 330
#define NOTE_G4 392
#define NOTE_A4 440
#define NOTE_C5 523
#define NOTE_E5 659
#define NOTE_G5 784

const int DURATION_1_16 = 62; // 1/16 note
const int DURATION_1_8 = 125; // 1/8 note
const int DURATION_1_4 = 250; // 1/4 note
Expand Down Expand Up @@ -189,3 +197,17 @@ void playComboTune()
};
playTones(melody, sizeof(melody) / sizeof(ToneDuration));
}

void play4ClickDown()
{
ToneDuration melody[] = {{NOTE_G5, 55}, {NOTE_E5, 55}, {NOTE_C5, 60}, {NOTE_A4, 55}, {NOTE_G4, 55},
{NOTE_E4, 65}, {NOTE_C4, 80}, {NOTE_G3, 120}, {NOTE_E3, 160}, {NOTE_SILENT, 120}};
playTones(melody, sizeof(melody) / sizeof(ToneDuration));
}

void play4ClickUp()
{
// Quick high-pitched notes with trills
ToneDuration melody[] = {{NOTE_F5, 50}, {NOTE_G6, 45}, {NOTE_E7, 60}};
playTones(melody, sizeof(melody) / sizeof(ToneDuration));
}
2 changes: 2 additions & 0 deletions src/buzz/buzz.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ void playShutdownMelody();
void playGPSEnableBeep();
void playGPSDisableBeep();
void playComboTune();
void play4ClickDown();
void play4ClickUp();
void playBoop();
void playChirp();
void playClick();
Expand Down
16 changes: 15 additions & 1 deletion src/input/ButtonThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,21 @@ int32_t ButtonThread::runOnce()
this->notifyObservers(&evt);
playComboTune();
break;

#if !HAS_SCREEN
case 4:
if (moduleConfig.external_notification.enabled && externalNotificationModule) {
externalNotificationModule->setMute(!externalNotificationModule->getMute());
IF_SCREEN(if (!externalNotificationModule->getMute()) externalNotificationModule->stopNow();)
if (externalNotificationModule->getMute()) {
LOG_INFO("Temporarily Muted");
play4ClickDown(); // Disable tone
} else {
LOG_INFO("Unmuted");
play4ClickUp(); // Enable tone
}
}
break;
#endif
// No valid multipress action
default:
break;
Expand Down
2 changes: 2 additions & 0 deletions variants/nrf52840/rak_wismeshtag/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG

#define RAK_4631 1

#define HAS_SCREEN 0

#ifdef __cplusplus
}
#endif
Expand Down