Browse Source

AP_Param: we don't need to avoid writes in AP_Param now

now handled in the HAL
mission-4.1.18
Andrew Tridgell 12 years ago
parent
commit
f44f7308e8
  1. 13
      libraries/AP_Param/AP_Param.cpp

13
libraries/AP_Param/AP_Param.cpp

@ -67,19 +67,10 @@ uint8_t AP_Param::_num_vars;
// storage and naming information about all types that can be saved // storage and naming information about all types that can be saved
const AP_Param::Info *AP_Param::_var_info; const AP_Param::Info *AP_Param::_var_info;
// write to EEPROM, checking each byte to avoid writing // write to EEPROM
// bytes that are already correct
void AP_Param::eeprom_write_check(const void *ptr, uint16_t ofs, uint8_t size) void AP_Param::eeprom_write_check(const void *ptr, uint16_t ofs, uint8_t size)
{ {
const uint8_t *b = (const uint8_t *)ptr; hal.storage->write_block(ofs, ptr, size);
while (size--) {
uint8_t v = hal.storage->read_byte(ofs);
if (v != *b) {
hal.storage->write_byte(ofs, *b);
}
b++;
ofs++;
}
} }
// write a sentinal value at the given offset // write a sentinal value at the given offset

Loading…
Cancel
Save