Add STM32 EEPROM initialization at startup (#475)

This commit is contained in:
Ben Lye 2020-11-30 17:11:35 +00:00 committed by GitHub
parent 20e32c4cb0
commit 7bb1cb9ae3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -401,6 +401,17 @@ void setup()
delay(1000);
}
#endif
// Initialize the EEPROM
uint16_t eepromStatus = EEPROM.init();
debugln("EEPROM initialized: %d",eepromStatus);
// If there was no valid EEPROM page the EEPROM is corrupt or uninitialized and should be formatted
if( eepromStatus == EEPROM_NO_VALID_PAGE )
{
EEPROM.format();
debugln("No valid EEPROM page, EEPROM formatted");
}
#else
//ATMEGA328p
// all inputs