From f59be0aa2a350e6be8e4dd4947c0ce8734df88fe Mon Sep 17 00:00:00 2001 From: Olivier Date: Sat, 3 Dec 2016 16:53:36 +0100 Subject: [PATCH] ESP8266: remove redundant EEPROM check (#668) --- core/MyHwESP8266.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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)