Skip to content

Commit b682ab3

Browse files
XaositekthebenternCopilot
authored
Allow vibra or buzzer only notifications to obey cutoff (#8342)
* Allow vibra or buzzer only notifications to obey cutoff * Update src/modules/ExternalNotificationModule.cpp Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Ben Meadors <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent 153cf65 commit b682ab3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/modules/ExternalNotificationModule.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,15 @@ int32_t ExternalNotificationModule::runOnce()
9494
// audioThread->isPlaying() also handles actually playing the RTTTL, needs to be called in loop
9595
isRtttlPlaying = isRtttlPlaying || audioThread->isPlaying();
9696
#endif
97-
if ((nagCycleCutoff < millis()) && !isRtttlPlaying) {
98-
// let the song finish if we reach timeout
97+
if ((nagCycleCutoff <= millis())) {
98+
// Turn off external notification immediately when timeout is reached, regardless of song state
9999
nagCycleCutoff = UINT32_MAX;
100100
LOG_INFO("Turning off external notification: ");
101101
for (int i = 0; i < 3; i++) {
102102
setExternalState(i, false);
103103
externalTurnedOn[i] = 0;
104104
LOG_INFO("%d ", i);
105105
}
106-
LOG_INFO("");
107106
#ifdef HAS_I2S
108107
// GPIO0 is used as mclk for I2S audio and set to OUTPUT by the sound library
109108
// T-Deck uses GPIO0 as trackball button, so restore the mode

0 commit comments

Comments
 (0)