mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-02-09 22:38:10 +00:00
Add STM32 EEPROM initialization at startup (#475)
This commit is contained in:
parent
20e32c4cb0
commit
7bb1cb9ae3
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user