|
|
|
@ -315,7 +315,9 @@ bool AP_FlashStorage::write_all()
@@ -315,7 +315,9 @@ bool AP_FlashStorage::write_all()
|
|
|
|
|
debug("write_all to sector %u at %u with reserved_space=%u\n", |
|
|
|
|
current_sector, write_offset, reserved_space); |
|
|
|
|
for (uint16_t ofs=0; ofs<storage_size; ofs += max_write) { |
|
|
|
|
uint8_t n = MIN(max_write, storage_size-ofs); |
|
|
|
|
// local variable needed to overcome problem with MIN() macro and -O0
|
|
|
|
|
const uint8_t max_write_local = max_write; |
|
|
|
|
uint8_t n = MIN(max_write_local, storage_size-ofs); |
|
|
|
|
if (!all_zero(ofs, n)) { |
|
|
|
|
if (!write(ofs, n)) { |
|
|
|
|
return false; |
|
|
|
|