Browse Source

HAL_ChibiOS: avoid unnecessary H7 flash writes

zr-v5.1
Andrew Tridgell 5 years ago
parent
commit
74f33d57c5
  1. 3
      libraries/AP_HAL_ChibiOS/hwdef/common/flash.c

3
libraries/AP_HAL_ChibiOS/hwdef/common/flash.c

@ -448,7 +448,8 @@ static bool stm32_flash_write_h7(uint32_t addr, const void *buf, uint32_t count) @@ -448,7 +448,8 @@ static bool stm32_flash_write_h7(uint32_t addr, const void *buf, uint32_t count)
}
stm32_flash_unlock();
while (count >= 32) {
if (!stm32h7_flash_write32(addr, b)) {
if (memcmp((void*)addr, b, 32) != 0 &&
!stm32h7_flash_write32(addr, b)) {
return false;
}
// check contents

Loading…
Cancel
Save