From 75dc8cccecd52da78f1d69eeb4eb017fbc68f26c Mon Sep 17 00:00:00 2001 From: todd-herbert Date: Thu, 9 May 2024 09:08:24 +1200 Subject: [PATCH] Button ISR runs thread asap (#3801) --- src/ButtonThread.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ButtonThread.cpp b/src/ButtonThread.cpp index 4566de9240..97cce7bc2b 100644 --- a/src/ButtonThread.cpp +++ b/src/ButtonThread.cpp @@ -214,6 +214,7 @@ int32_t ButtonThread::runOnce() btnEvent = BUTTON_EVENT_NONE; } + runASAP = false; return 50; } @@ -234,6 +235,7 @@ void ButtonThread::attachButtonInterrupts() BaseType_t higherWake = 0; mainDelay.interruptFromISR(&higherWake); ButtonThread::userButton.tick(); + runASAP = true; }, CHANGE); #endif @@ -280,6 +282,7 @@ void ButtonThread::wakeOnIrq(int irq, int mode) [] { BaseType_t higherWake = 0; mainDelay.interruptFromISR(&higherWake); + runASAP = true; }, FALLING); }