From 03e7ff1983913b66d9e044db69987e13380909bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sun, 16 Jul 2023 14:43:57 +0000 Subject: [PATCH] power panic: optimise incrementing EEPROM statistics Change in memory: Flash: -26 bytes SRAM: 0 bytes --- Firmware/power_panic.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Firmware/power_panic.cpp b/Firmware/power_panic.cpp index 0c0837c6a..7797a8b66 100644 --- a/Firmware/power_panic.cpp +++ b/Firmware/power_panic.cpp @@ -271,8 +271,8 @@ static void uvlo_tiny() { eeprom_update_byte((uint8_t*)EEPROM_UVLO, PENDING_RECOVERY_RETRY); // Increment power failure counter - eeprom_update_byte((uint8_t*)EEPROM_POWER_COUNT, eeprom_read_byte((uint8_t*)EEPROM_POWER_COUNT) + 1); - eeprom_update_word((uint16_t*)EEPROM_POWER_COUNT_TOT, eeprom_read_word((uint16_t*)EEPROM_POWER_COUNT_TOT) + 1); + eeprom_increment_byte((uint8_t*)EEPROM_POWER_COUNT); + eeprom_increment_word((uint16_t*)EEPROM_POWER_COUNT_TOT); printf_P(_N("UVLO_TINY - end %d\n"), _millis() - time_start); uvlo_drain_reset();