From f9472e68724986f3d17feee7c7cafcdc4c6738f5 Mon Sep 17 00:00:00 2001 From: Martin Vladic Date: Wed, 16 Sep 2020 22:12:57 +0200 Subject: [PATCH 1/2] Update firmware.cpp --- src/eez/firmware.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/eez/firmware.cpp b/src/eez/firmware.cpp index 1b76a021b..c711f58bd 100644 --- a/src/eez/firmware.cpp +++ b/src/eez/firmware.cpp @@ -368,7 +368,9 @@ void shutdown() { g_shutdownInProgress = true; +#if OPTION_ETHERNET ethernet::update(); +#endif #if !defined(__EMSCRIPTEN__) // shutdown SCPI thread From 9e481668f1078371ade5851ea13f950f27f529a5 Mon Sep 17 00:00:00 2001 From: Martin Vladic Date: Wed, 16 Sep 2020 22:24:52 +0200 Subject: [PATCH 2/2] Update eeprom.cpp --- src/eez/modules/bp3c/eeprom.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/eez/modules/bp3c/eeprom.cpp b/src/eez/modules/bp3c/eeprom.cpp index 55b5019c9..2db6bc574 100644 --- a/src/eez/modules/bp3c/eeprom.cpp +++ b/src/eez/modules/bp3c/eeprom.cpp @@ -115,9 +115,12 @@ bool read(uint8_t slotIndex, uint8_t *buffer, uint16_t bufferSize, uint16_t addr size_t readBytes = fread(buffer, 1, bufferSize, fp); fclose(fp); - return readBytes == bufferSize; + if (readBytes == 4) { + readBytes += 2; + ((uint16_t *)buffer)[2] = 0xA5A5; + } - return true; + return readBytes == bufferSize; #endif } @@ -211,9 +214,10 @@ bool test() { void writeModuleType(uint8_t slotIndex, uint16_t moduleType) { uint16_t buffer[] = { moduleType, - getModule(moduleType)->latestModuleRevision + getModule(moduleType)->latestModuleRevision, + 0xA5A5 }; - write(slotIndex, (uint8_t *)buffer, 4, 0); + write(slotIndex, (uint8_t *)buffer, sizeof(buffer), 0); } void resetAllExceptOnTimeCounters(uint8_t slotIndex) {