diff --git a/firmware/atmega/source/eeprom.c b/firmware/atmega/source/eeprom.c index cbbcffe..6053e9a 100644 --- a/firmware/atmega/source/eeprom.c +++ b/firmware/atmega/source/eeprom.c @@ -23,3 +23,13 @@ void eepromWrite(uint8_t address, uint8_t data) { EECR |= (1 << EEPE); } } + +void eepromFlush(uint8_t address) { + if (eepromRead(address) != 0) { + EEAR = address; + EEDR = 0; + + EECR |= (1 << EEMPE); + EECR |= (1 << EEPE); + } +}