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

Ensured board info is preserved through invalid EEPROM version triggered reset.

This commit is contained in:
mikeller 2018-05-31 02:06:26 +12:00
parent 432f330e60
commit 467a490a53
3 changed files with 15 additions and 4 deletions

View file

@ -240,13 +240,14 @@ void init(void)
initEEPROM();
ensureEEPROMStructureIsValid();
bool readSuccess = readEEPROM();
#if defined(USE_BOARD_INFO)
initBoardInformation();
#endif
if (!readSuccess || strncasecmp(systemConfig()->boardIdentifier, TARGET_BOARD_IDENTIFIER, sizeof(TARGET_BOARD_IDENTIFIER))) {
if (!readSuccess || !isEEPROMVersionValid() || strncasecmp(systemConfig()->boardIdentifier, TARGET_BOARD_IDENTIFIER, sizeof(TARGET_BOARD_IDENTIFIER))) {
resetEEPROM();
activateConfig();