mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 03:20:00 +03:00
Make three attempts to not only write to FLASH, but also validate it (#14001)
This commit is contained in:
parent
954cc1da3a
commit
b819eceb86
1 changed files with 2 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue