Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Sep 17, 2020
2 parents 0eb36e6 + 9e48166 commit 7b7fb7b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/eez/firmware.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,9 @@ void shutdown() {

g_shutdownInProgress = true;

#if OPTION_ETHERNET
ethernet::update();
#endif

#if !defined(__EMSCRIPTEN__)
// shutdown SCPI thread
Expand Down
12 changes: 8 additions & 4 deletions src/eez/modules/bp3c/eeprom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

}
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 7b7fb7b

Please sign in to comment.