From 4b82e80d7a9acfa30fc76f847871d063611c2aed Mon Sep 17 00:00:00 2001 From: Conor Patrick Date: Sat, 2 Mar 2019 20:08:15 -0500 Subject: [PATCH] init device with nfc detection --- targets/stm32l432/src/device.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/targets/stm32l432/src/device.c b/targets/stm32l432/src/device.c index 533f4bd..c619e80 100644 --- a/targets/stm32l432/src/device.c +++ b/targets/stm32l432/src/device.c @@ -110,29 +110,25 @@ void device_reboot() void device_init() { - hw_init(HIGH_FREQUENCY); + hw_init(LOW_FREQUENCY); isLowFreq = 0; - nfc_init(); - // haveNFC = nfc_init(); + haveNFC = nfc_init(); - // if (haveNFC) - // { - // printf1(TAG_NFC, "Have NFC\r\n"); - // } - // else - // { - // printf1(TAG_NFC, "Have NO NFC\r\n"); - // hw_init(HIGH_FREQUENCY); - // - // isLowFreq = 0; - // } + if (haveNFC) + { + printf1(TAG_NFC, "Have NFC\r\n"); + } + else + { + printf1(TAG_NFC, "Have NO NFC\r\n"); + hw_init(HIGH_FREQUENCY); + isLowFreq = 0; + } usbhid_init(); - ctaphid_init(); - - ctap_init( 1 ); + ctap_init(); #if BOOT_TO_DFU flash_option_bytes_init(1);