From e294cb34581faa14e887b136685c802a84cf67e9 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 b04a640..4073fe7 100644 --- a/targets/stm32l432/src/device.c +++ b/targets/stm32l432/src/device.c @@ -577,7 +577,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) {