From f5fc08617787574c5d98e301e033fa53711e98da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20St=C3=A4ck?= Date: Mon, 24 Jun 2019 16:01:27 +0200 Subject: [PATCH] Only write to file if value has actually changed. --- simulation/src/simeeprom.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/simulation/src/simeeprom.cpp b/simulation/src/simeeprom.cpp index 5c960ec..c3fb3c5 100644 --- a/simulation/src/simeeprom.cpp +++ b/simulation/src/simeeprom.cpp @@ -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)