Skip to content

Commit

Permalink
Make three attempts to not only write to FLASH, but also validate it (b…
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveCEvans authored Oct 31, 2024
1 parent 954cc1d commit b819ece
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main/config/config_eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -523,8 +523,7 @@ void writeConfigToEEPROM(void)
}
}


if (success && isEEPROMVersionValid() && isEEPROMStructureValid()) {
if (success) {
return;
}

Expand Down

0 comments on commit b819ece

Please sign in to comment.