diff --git a/AfRApay.MateCard/src/main.cpp b/AfRApay.MateCard/src/main.cpp index b3cfbfb..8bffcb3 100644 --- a/AfRApay.MateCard/src/main.cpp +++ b/AfRApay.MateCard/src/main.cpp @@ -82,6 +82,13 @@ bool cooldownCheck(long timeout) { void setup() { Serial.begin(115200); Serial2.begin(115200, SERIAL_8N1, PIN_HWSERIAL_RX, PIN_HWSERIAL_TX); + + ledcSetup(0, 5000, 12); + pinMode(PIN_INTERRUPT_TRANSACT, INPUT_PULLUP); + pinMode(PIN_INTERRUPT_BALANCE, INPUT_PULLUP); + pinMode(PIN_INTERRUPT_CANCEL, INPUT_PULLUP); + pinMode(PIN_INTERRUPT_LINK, INPUT_PULLUP); + u8g2.begin(); drawLogo(u8g2, LOGO_MATECARD); u8g2.sendBuffer(); @@ -97,11 +104,6 @@ void setup() { DateTime.begin(); updateOLED(u8g2, state); - ledcSetup(0, 5000, 12); - pinMode(PIN_INTERRUPT_TRANSACT, INPUT_PULLUP); - pinMode(PIN_INTERRUPT_BALANCE, INPUT_PULLUP); - pinMode(PIN_INTERRUPT_CANCEL, INPUT_PULLUP); - pinMode(PIN_INTERRUPT_LINK, INPUT_PULLUP); attachInterrupt(PIN_INTERRUPT_TRANSACT, TransactInterruptHandler, FALLING); attachInterrupt(PIN_INTERRUPT_BALANCE, BalanceInterruptHandler, FALLING); attachInterrupt(PIN_INTERRUPT_CANCEL, CancelInterruptHandler, FALLING);