mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-14 14:52:32 +00:00
Fix dismiss of ext. notification (#8512)
* Dismiss all ext notifications with any input broker event * Account for nagging
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
#include "InputBroker.h"
|
#include "InputBroker.h"
|
||||||
#include "PowerFSM.h" // needed for event trigger
|
#include "PowerFSM.h" // needed for event trigger
|
||||||
|
#include "configuration.h"
|
||||||
|
#include "modules/ExternalNotificationModule.h"
|
||||||
|
|
||||||
InputBroker *inputBroker = nullptr;
|
InputBroker *inputBroker = nullptr;
|
||||||
|
|
||||||
@@ -48,6 +50,12 @@ void InputBroker::processInputEventQueue()
|
|||||||
int InputBroker::handleInputEvent(const InputEvent *event)
|
int InputBroker::handleInputEvent(const InputEvent *event)
|
||||||
{
|
{
|
||||||
powerFSM.trigger(EVENT_INPUT); // todo: not every input should wake, like long hold release
|
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);
|
this->notifyObservers(event);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -325,6 +325,10 @@ void ExternalNotificationModule::stopNow()
|
|||||||
drv.stop();
|
drv.stop();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Prevent the state machine from immediately re-triggering outputs after a manual stop.
|
||||||
|
isNagging = false;
|
||||||
|
nagCycleCutoff = UINT32_MAX;
|
||||||
|
|
||||||
#ifdef HAS_I2S
|
#ifdef HAS_I2S
|
||||||
// GPIO0 is used as mclk for I2S audio and set to OUTPUT by the sound library
|
// 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
|
// T-Deck uses GPIO0 as trackball button, so restore the mode
|
||||||
|
|||||||
Reference in New Issue
Block a user