diff --git a/core/MyHwESP8266.cpp b/core/MyHwESP8266.cpp index e43fafd..c4d39d1 100644 --- a/core/MyHwESP8266.cpp +++ b/core/MyHwESP8266.cpp @@ -43,15 +43,11 @@ void hwWriteConfigBlock(void* buf, void* addr, size_t length) { uint8_t* src = static_cast(buf); int pos = reinterpret_cast(addr); - bool doCommit = false; while (length-- > 0) { - doCommit |= EEPROM.read(pos) != *src; EEPROM.write(pos++, *src++); } - // only commit if there are changes - if (doCommit) { - EEPROM.commit(); - } + // see implementation, commit only executed if diff + EEPROM.commit(); } uint8_t hwReadConfig(const int addr)