From a7796fc7b486af5ce03f3f4740f6d666743ec00c Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 1 Nov 2025 21:11:36 -0500 Subject: [PATCH] Fix dismiss of ext. notification (#8512) * Dismiss all ext notifications with any input broker event * Account for nagging --- src/input/InputBroker.cpp | 8 ++++++++ src/modules/ExternalNotificationModule.cpp | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/src/input/InputBroker.cpp b/src/input/InputBroker.cpp index 39fc665c5..7e3ff3de9 100644 --- a/src/input/InputBroker.cpp +++ b/src/input/InputBroker.cpp @@ -1,5 +1,7 @@ #include "InputBroker.h" #include "PowerFSM.h" // needed for event trigger +#include "configuration.h" +#include "modules/ExternalNotificationModule.h" InputBroker *inputBroker = nullptr; @@ -48,6 +50,12 @@ void InputBroker::processInputEventQueue() int InputBroker::handleInputEvent(const InputEvent *event) { powerFSM.trigger(EVENT_INPUT); // todo: not every input should wake, like long hold release + + if (event && event->inputEvent != INPUT_BROKER_NONE && externalNotificationModule && + moduleConfig.external_notification.enabled) { + externalNotificationModule->stopNow(); + } + this->notifyObservers(event); return 0; } diff --git a/src/modules/ExternalNotificationModule.cpp b/src/modules/ExternalNotificationModule.cpp index b047e04c2..4fe49cc1b 100644 --- a/src/modules/ExternalNotificationModule.cpp +++ b/src/modules/ExternalNotificationModule.cpp @@ -325,6 +325,10 @@ void ExternalNotificationModule::stopNow() drv.stop(); #endif + // Prevent the state machine from immediately re-triggering outputs after a manual stop. + isNagging = false; + nagCycleCutoff = UINT32_MAX; + #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