Skip to content

Commit

Permalink
Fixed single-byte configuration changes not working on nRF
Browse files Browse the repository at this point in the history
  • Loading branch information
markqvist committed Jan 15, 2025
1 parent 6b815c4 commit 7066b4d
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions Utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -1396,7 +1396,6 @@ void kiss_dump_eeprom() {

#if !HAS_EEPROM && MCU_VARIANT == MCU_NRF52
void eeprom_flush() {
// sync file contents to flash
file.close();
file.open(EEPROM_FILE, FILE_O_WRITE);
written_bytes = 0;
Expand All @@ -1423,19 +1422,7 @@ void eeprom_update(int mapped_addr, uint8_t byte) {
file.write(byte);
}
written_bytes++;

if ((mapped_addr - eeprom_addr(0)) == ADDR_INFO_LOCK) {
#if !HAS_EEPROM && MCU_VARIANT == MCU_NRF52
// have to do a flush because we're only writing 1 byte and it syncs after 4
eeprom_flush();
#endif
}

if (written_bytes >= 4) {
file.close();
file.open(EEPROM_FILE, FILE_O_WRITE);
written_bytes = 0;
}
eeprom_flush();
#endif
}

Expand Down

0 comments on commit 7066b4d

Please sign in to comment.