Add cancel button interrupt

This commit is contained in:
Laura Hausmann 2023-02-08 19:54:30 +01:00
parent d339858312
commit f6566d9a42
Signed by: zotan
GPG key ID: D044E84C5BE01605

View file

@ -83,6 +83,10 @@ void IRAM_ATTR BalanceInterruptHandler() {
state = STATE_BALANCE_CARDSCAN;
}
void IRAM_ATTR CancelInterruptHandler() {
state = STATE_IDLE;
}
bool cooldownCheck(long timeout) {
if (millis() - timer > timeout) {
state = STATE_IDLE;
@ -118,6 +122,7 @@ void setup() {
pinMode(PIN_INTERRUPT_LINK, INPUT_PULLUP);
attachInterrupt(PIN_INTERRUPT_TRANSACT, TransactInterruptHandler, FALLING);
attachInterrupt(PIN_INTERRUPT_BALANCE, BalanceInterruptHandler, FALLING);
attachInterrupt(PIN_INTERRUPT_CANCEL, CancelInterruptHandler, FALLING);
attachInterrupt(PIN_INTERRUPT_LINK, LinkInterruptHandler, FALLING);
}