mirror of https://github.com/ArduPilot/ardupilot
AP_FlashStorage: fixed build error with -O0
This commit is contained in:
parent
a7eb85e1c5
commit
d2c9db3f1f
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue