diff --git a/targets/stm32l432/src/app.h b/targets/stm32l432/src/app.h index c0353a0..5753d14 100644 --- a/targets/stm32l432/src/app.h +++ b/targets/stm32l432/src/app.h @@ -30,6 +30,7 @@ // #define DISABLE_CTAPHID_WINK // #define DISABLE_CTAPHID_CBOR +// #define ENABLE_SERIAL_PRINTING #if defined(SOLO_HACKER) #define SOLO_PRODUCT_NAME "Solo Hacker " SOLO_VERSION diff --git a/targets/stm32l432/src/nfc.c b/targets/stm32l432/src/nfc.c index 85da81a..dc66235 100644 --- a/targets/stm32l432/src/nfc.c +++ b/targets/stm32l432/src/nfc.c @@ -444,7 +444,7 @@ void nfc_process_iblock(uint8_t * buf, int len) else { nfc_write_response(buf[0], SW_FILE_NOT_FOUND); - printf1(TAG_NFC, "NOT selected\r\n"); dump_hex1(TAG_NFC,res, 3); + printf1(TAG_NFC, "NOT selected\r\n"); dump_hex1(TAG_NFC,payload, plen); } } break; @@ -495,7 +495,7 @@ void nfc_process_iblock(uint8_t * buf, int len) - printf1(TAG_NFC,"U2F Register answered %d (took %d)\r\n", millis(), millis() - t1); + printf1(TAG_NFC,"U2F Register answered %d (took %d)\r\n", millis(), timestamp()); break; case APDU_FIDO_U2F_AUTHENTICATE: @@ -532,8 +532,7 @@ void nfc_process_iblock(uint8_t * buf, int len) break; } - timestamp(); - printf1(TAG_NFC, "FIDO2 CTAP message. %d\r\n", t1); + printf1(TAG_NFC, "FIDO2 CTAP message. %d\r\n", timestamp()); WTX_on(WTX_TIME_DEFAULT); ctap_response_init(&ctap_resp); diff --git a/targets/stm32l432/src/redirect.c b/targets/stm32l432/src/redirect.c index f601ad8..ed4147f 100644 --- a/targets/stm32l432/src/redirect.c +++ b/targets/stm32l432/src/redirect.c @@ -24,7 +24,7 @@ void _putchar(char c) } -int _write (int fd, const void *buf, long int len) +int _write (int fd, const void *buf, unsigned long int len) { uint8_t * data = (uint8_t *) buf; #if DEBUG_LEVEL>1 @@ -43,11 +43,14 @@ int _write (int fd, const void *buf, long int len) if (res == USBD_OK) logbuflen = 0; #endif +#ifdef ENABLE_SERIAL_PRINTING // Send out UART serial while(len--) { _putchar(*data++); } +#endif return 0; + } #endif