1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 16:55:36 +03:00

Merge pull request #5991 from mikeller/reset_config_on_pg_changes

Reset the entire config when parameter groups have changed.
This commit is contained in:
Michael Keller 2018-05-29 11:12:42 +12:00 committed by GitHub
commit e0aa43b259
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 36 additions and 20 deletions

View file

@ -238,12 +238,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;