Skip to content

Commit

Permalink
use 0xff as default if eeprom is not yet valid
Browse files Browse the repository at this point in the history
  • Loading branch information
tuxedo0801 authored Sep 4, 2017
1 parent 44dc6e4 commit 75dec50
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/FlashAsEEPROM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ void EEPROMClass::write(int address, uint8_t value)
void EEPROMClass::init()
{
_eeprom = eeprom_storage.read();
if (!_eeprom.valid) {
memset(_eeprom.data, 0xFF, EEPROM_EMULATION_SIZE);
}
_initialized = true;
}

Expand Down

0 comments on commit 75dec50

Please sign in to comment.