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 <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Jason P 2025-10-23 11:54:05 -05:00 committed by GitHub
parent 153cf65214
commit b682ab3967
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -94,8 +94,8 @@ int32_t ExternalNotificationModule::runOnce()
// audioThread->isPlaying() also handles actually playing the RTTTL, needs to be called in loop
isRtttlPlaying = isRtttlPlaying || audioThread->isPlaying();
#endif
if ((nagCycleCutoff < millis()) && !isRtttlPlaying) {
// let the song finish if we reach timeout
if ((nagCycleCutoff <= millis())) {
// Turn off external notification immediately when timeout is reached, regardless of song state
nagCycleCutoff = UINT32_MAX;
LOG_INFO("Turning off external notification: ");
for (int i = 0; i < 3; i++) {
@ -103,7 +103,6 @@ int32_t ExternalNotificationModule::runOnce()
externalTurnedOn[i] = 0;
LOG_INFO("%d ", i);
}
LOG_INFO("");
#ifdef HAS_I2S
// GPIO0 is used as mclk for I2S audio and set to OUTPUT by the sound library
// T-Deck uses GPIO0 as trackball button, so restore the mode