Add cancel button interrupt
This commit is contained in:
parent
d339858312
commit
f6566d9a42
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue