Skip to content

Commit

Permalink
Button ISR runs thread asap (#3801)
Browse files Browse the repository at this point in the history
  • Loading branch information
todd-herbert authored May 8, 2024
1 parent 147de75 commit 75dc8cc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ButtonThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ int32_t ButtonThread::runOnce()
btnEvent = BUTTON_EVENT_NONE;
}

runASAP = false;
return 50;
}

Expand All @@ -234,6 +235,7 @@ void ButtonThread::attachButtonInterrupts()
BaseType_t higherWake = 0;
mainDelay.interruptFromISR(&higherWake);
ButtonThread::userButton.tick();
runASAP = true;
},
CHANGE);
#endif
Expand Down Expand Up @@ -280,6 +282,7 @@ void ButtonThread::wakeOnIrq(int irq, int mode)
[] {
BaseType_t higherWake = 0;
mainDelay.interruptFromISR(&higherWake);
runASAP = true;
},
FALLING);
}
Expand Down

0 comments on commit 75dc8cc

Please sign in to comment.