From b819eceb866dd93e4a96aba411602c7f7711a102 Mon Sep 17 00:00:00 2001 From: Steve Evans Date: Thu, 31 Oct 2024 13:45:16 +0000 Subject: [PATCH] Make three attempts to not only write to FLASH, but also validate it (#14001) --- src/main/config/config_eeprom.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/config/config_eeprom.c b/src/main/config/config_eeprom.c index 9e7553caf7..d625e59426 100644 --- a/src/main/config/config_eeprom.c +++ b/src/main/config/config_eeprom.c @@ -509,7 +509,7 @@ void writeConfigToEEPROM(void) bool success = false; // write it for (int attempt = 0; attempt < 3 && !success; attempt++) { - if (writeSettingsToEEPROM()) { + if (writeSettingsToEEPROM() && isEEPROMVersionValid() && isEEPROMStructureValid()) { success = true; #if defined(CONFIG_IN_EXTERNAL_FLASH) || defined(CONFIG_IN_MEMORY_MAPPED_FLASH) @@ -523,8 +523,7 @@ void writeConfigToEEPROM(void) } } - - if (success && isEEPROMVersionValid() && isEEPROMStructureValid()) { + if (success) { return; }