Browse Source

HAL_ChibiOS: removed unsafe ISR disable for bl update

can't disable interrupts and call a fn that takes a mutex
mission-4.1.18
Andrew Tridgell 6 years ago
parent
commit
352546c9f0
  1. 2
      libraries/AP_HAL_ChibiOS/Util.cpp

2
libraries/AP_HAL_ChibiOS/Util.cpp

@ -257,9 +257,7 @@ bool Util::flash_bootloader() @@ -257,9 +257,7 @@ bool Util::flash_bootloader()
hal.console->printf("Flashing %s @%08x\n", fw_name, (unsigned int)addr);
const uint8_t max_attempts = 10;
for (uint8_t i=0; i<max_attempts; i++) {
void *context = hal.scheduler->disable_interrupts_save();
bool ok = hal.flash->write(addr, fw, fw_size);
hal.scheduler->restore_interrupts(context);
if (!ok) {
hal.console->printf("Flash failed! (attempt=%u/%u)\n",
i+1,

Loading…
Cancel
Save