From a95e62e2ea80eeee08ecd936837af8bd50ba5217 Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Thu, 22 Aug 2019 15:33:28 +0300 Subject: [PATCH] reset --- targets/stm32l432/src/nfc.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/targets/stm32l432/src/nfc.c b/targets/stm32l432/src/nfc.c index b2aded8..d49782d 100644 --- a/targets/stm32l432/src/nfc.c +++ b/targets/stm32l432/src/nfc.c @@ -757,9 +757,15 @@ void apdu_process(uint8_t buf0, uint8_t *apduptr, APDU_STRUCT *apdu) break; case APDU_SOLO_RESET: - printf1(TAG_NFC, "Reset...\r\n"); - delay(10); - nfc_write_response(buf0, SW_INS_INVALID); + if (apdu.lc == 18 && !memcmp(apdu.data, "Reset solo please>", 18)) { + printf1(TAG_NFC, "Reset...\r\n"); + delay(10); + NVIC_SystemReset(); + while(1); + } else { + printf1(TAG_NFC, "Reset FAIL\r\n"); + nfc_write_response(buf[0], SW_INS_INVALID); + } break; default: