mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 16:55:36 +03:00
Reset the entire config when parameter groups have changed.
This commit is contained in:
parent
1ab7b7816b
commit
464da66ee1
7 changed files with 35 additions and 19 deletions
|
@ -237,12 +237,13 @@ void init(void)
|
|||
|
||||
initEEPROM();
|
||||
|
||||
ensureEEPROMContainsValidData();
|
||||
readEEPROM();
|
||||
ensureEEPROMStructureIsValid();
|
||||
bool readSuccess = readEEPROM();
|
||||
|
||||
// !!TODO: Check to be removed when moving to generic targets
|
||||
if (strncasecmp(systemConfig()->boardIdentifier, TARGET_BOARD_IDENTIFIER, sizeof(TARGET_BOARD_IDENTIFIER))) {
|
||||
if (!readSuccess || strncasecmp(systemConfig()->boardIdentifier, TARGET_BOARD_IDENTIFIER, sizeof(TARGET_BOARD_IDENTIFIER))) {
|
||||
resetEEPROM();
|
||||
|
||||
activateConfig();
|
||||
}
|
||||
|
||||
systemState |= SYSTEM_STATE_CONFIG_LOADED;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue