diff --git a/mote/v2/avr/ctrl.c b/mote/v2/avr/ctrl.c index 4870dd0..eac09fb 100644 --- a/mote/v2/avr/ctrl.c +++ b/mote/v2/avr/ctrl.c @@ -459,10 +459,10 @@ void ctrlCmdSet(uint8_t cmd) void ctrlCmdCommit(void) { cli(); - eeprom_write_block((const void*)&version, (void*)&EEPROM_version, sizeof(version)); - eeprom_write_block((const void*)&event, (void*)&EEPROM_event, sizeof(event)); - eeprom_write_block((const void*)&enabled, (void*)&EEPROM_enabled, sizeof(enabled)); - eeprom_write_block((const void*)&phy_to_log, (void*)&EEPROM_phy_to_log, sizeof(phy_to_log)); - eeprom_write_block((const void*)&sensor, (void*)&EEPROM_sensor, sizeof(sensor)); + eeprom_update_block((const void*)&version, (void*)&EEPROM_version, sizeof(version)); + eeprom_update_block((const void*)&event, (void*)&EEPROM_event, sizeof(event)); + eeprom_update_block((const void*)&enabled, (void*)&EEPROM_enabled, sizeof(enabled)); + eeprom_update_block((const void*)&phy_to_log, (void*)&EEPROM_phy_to_log, sizeof(phy_to_log)); + eeprom_update_block((const void*)&sensor, (void*)&EEPROM_sensor, sizeof(sensor)); sei(); } diff --git a/mote/v2/avr/main.c b/mote/v2/avr/main.c index 24908b3..cbbac14 100644 --- a/mote/v2/avr/main.c +++ b/mote/v2/avr/main.c @@ -245,8 +245,8 @@ ISR(TIMER1_CAPT_vect) event.brown_out++; - eeprom_write_block((const void*)&sensor, (void*)&EEPROM_sensor, sizeof(sensor)); - eeprom_write_block((const void*)&event, (void*)&EEPROM_event, sizeof(event)); + eeprom_update_block((const void*)&sensor, (void*)&EEPROM_sensor, sizeof(sensor)); + eeprom_update_block((const void*)&event, (void*)&EEPROM_event, sizeof(event)); // uint8_t i; // for (i=0; i<128; i++)