From 301e18c6a2a2d337729a2c4d768efbf4b522fe18 Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Tue, 16 Jul 2019 19:47:45 +0300 Subject: [PATCH] add some int0 logic to main cycle --- targets/stm32l432/src/nfc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/targets/stm32l432/src/nfc.c b/targets/stm32l432/src/nfc.c index 2a3d302..cdcaa8f 100644 --- a/targets/stm32l432/src/nfc.c +++ b/targets/stm32l432/src/nfc.c @@ -792,6 +792,7 @@ int nfc_loop() read_reg_block(&ams); + uint8_t old_int0 = gl_int0; process_int0(ams.regs.int0); uint8_t state = AMS_STATE_MASK & ams.regs.rfid_status; @@ -806,7 +807,7 @@ int nfc_loop() // if (state != AMS_STATE_SENSE) // printf1(TAG_NFC," %s x%02x\r\n", ams_get_state_string(ams.regs.rfid_status), state); } - if (ams.regs.int0 & AMS_INT_INIT) + if (ams.regs.int0 & AMS_INT_INIT || old_int0 & AMS_INT_INIT) { nfc_state_init(); } @@ -815,7 +816,7 @@ int nfc_loop() // ams_print_int1(ams.regs.int1); } - if ((ams.regs.int0 & AMS_INT_RXE)) + if (ams.regs.int0 & AMS_INT_RXE || old_int0 & AMS_INT_RXE) { if (ams.regs.buffer_status2) {