From be99caf2a23303c5eabeef7b48c8dbd6ffc4c241 Mon Sep 17 00:00:00 2001 From: Conor Patrick Date: Tue, 29 Oct 2019 08:25:58 -0400 Subject: [PATCH] replace counter instead of increment for large increment --- targets/stm32l432/src/device.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/targets/stm32l432/src/device.c b/targets/stm32l432/src/device.c index d2525c6..3cc4551 100644 --- a/targets/stm32l432/src/device.c +++ b/targets/stm32l432/src/device.c @@ -560,7 +560,11 @@ uint32_t ctap_atomic_count(uint32_t amount) return lastc; } - lastc += amount; + if (amount > lastc){ + lastc = amount; + } else { + lastc += amount; + } if (lastc/256 > erases) {