Toggle up to 3 pins after output_ms till nag_timeout or user button press happens

This commit is contained in:
Thomas Göttgens
2022-12-08 16:27:56 +01:00
parent 60e6dc1134
commit 32d9a397aa
7 changed files with 188 additions and 81 deletions

View File

@@ -4,6 +4,7 @@
#include "concurrency/OSThread.h"
#include "configuration.h"
#include "graphics/Screen.h"
#include "modules/ExternalNotificationModule.h"
#include "power.h"
#include <OneButton.h>
@@ -114,6 +115,10 @@ class ButtonThread : public concurrency::OSThread
{
// DEBUG_MSG("press!\n");
#ifdef BUTTON_PIN
// If a nag notification is running, stop it
if (externalNotificationModule->nagCycleCutoff != UINT32_MAX) {
externalNotificationModule->nagCycleCutoff = 0;
}
if ((BUTTON_PIN != moduleConfig.canned_message.inputbroker_pin_press) ||
!moduleConfig.canned_message.enabled) {
powerFSM.trigger(EVENT_PRESS);