From dfae055f042ebd19ce637e8acd80586b8e70e84f Mon Sep 17 00:00:00 2001 From: Cabooman <81711263+Cabooman@users.noreply.github.com> Date: Mon, 12 Feb 2024 21:29:36 +0100 Subject: [PATCH] Clear before Set --- Software/src/devboard/utils/events.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Software/src/devboard/utils/events.cpp b/Software/src/devboard/utils/events.cpp index a3c82eb2..c11b9bfd 100644 --- a/Software/src/devboard/utils/events.cpp +++ b/Software/src/devboard/utils/events.cpp @@ -385,6 +385,11 @@ static void check_ee_write(void) { EEPROM.commit(); events.nof_eeprom_writes += (events.nof_eeprom_writes < 65535) ? 1 : 0; events.nof_logged_events = 0; + + // We want to know how many writes we have, and to increment the occurrence counter + // we need to clear it first. It's just the way life is. Using events is a smooth + // way to visualize it in the web UI + clear_event(EVENT_EEPROM_WRITE); set_event(EVENT_EEPROM_WRITE, events.nof_eeprom_writes); } }