Only write to file if value has actually changed.

This commit is contained in:
John Stäck 2019-06-24 16:01:27 +02:00
parent 2c3df24fc1
commit f5fc086177

View file

@ -23,6 +23,13 @@ uint8_t EEPROMClass::read( int idx )
void EEPROMClass::write( int idx, uint8_t val )
{
printf("Writing to EEPROM address %u = %u\n", idx, val);
if(val == someFakeEEPROM_memory[idx])
{
//Value unchanged, do nothing.
return;
}
someFakeEEPROM_memory[idx] = val;
if(autoUpdate && storage)