[avr] subsitute eeprom_write_block for eeprom_update_block so that a byte is written only when it differs from the value stored in EEPROM
This commit is contained in:
parent
acf658dd26
commit
5df1cae92c
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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++)
|
||||
|
|
Loading…
Reference in New Issue