From 9ecfda02c5a334c7617190e11a384ff10f173710 Mon Sep 17 00:00:00 2001 From: Conor Patrick Date: Tue, 8 Oct 2019 14:26:33 -0400 Subject: [PATCH] remove atomic counter from bootloader to save space --- targets/stm32l432/bootloader/bootloader.c | 7 +++++++ targets/stm32l432/src/device.c | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/targets/stm32l432/bootloader/bootloader.c b/targets/stm32l432/bootloader/bootloader.c index 325572e..cf582c8 100644 --- a/targets/stm32l432/bootloader/bootloader.c +++ b/targets/stm32l432/bootloader/bootloader.c @@ -316,3 +316,10 @@ void bootloader_heartbeat() led_rgb(((val * g)<<8) | ((val*r) << 16) | (val*b)); } + +uint32_t ctap_atomic_count(uint32_t amount) +{ + static uint32_t count = 1000; + count += (amount + 1); + return count; +} \ No newline at end of file diff --git a/targets/stm32l432/src/device.c b/targets/stm32l432/src/device.c index 54a51b4..dd4e9c5 100644 --- a/targets/stm32l432/src/device.c +++ b/targets/stm32l432/src/device.c @@ -410,6 +410,7 @@ void authenticator_write_state(AuthenticatorState * a, int backup) } } +#if !defined(IS_BOOTLOADER) uint32_t ctap_atomic_count(uint32_t amount) { int offset = 0; @@ -501,7 +502,7 @@ uint32_t ctap_atomic_count(uint32_t amount) return lastc; } - +#endif void device_manage(void)