mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 19:40:31 +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;
|
bool success = false;
|
||||||
// write it
|
// write it
|
||||||
for (int attempt = 0; attempt < 3 && !success; attempt++) {
|
for (int attempt = 0; attempt < 3 && !success; attempt++) {
|
||||||
if (writeSettingsToEEPROM()) {
|
if (writeSettingsToEEPROM() && isEEPROMVersionValid() && isEEPROMStructureValid()) {
|
||||||
success = true;
|
success = true;
|
||||||
|
|
||||||
#if defined(CONFIG_IN_EXTERNAL_FLASH) || defined(CONFIG_IN_MEMORY_MAPPED_FLASH)
|
#if defined(CONFIG_IN_EXTERNAL_FLASH) || defined(CONFIG_IN_MEMORY_MAPPED_FLASH)
|
||||||
|
@ -523,8 +523,7 @@ void writeConfigToEEPROM(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (success) {
|
||||||
if (success && isEEPROMVersionValid() && isEEPROMStructureValid()) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue