HAL_ChibiOS: removed unsafe ISR disable for bl update

can't disable interrupts and call a fn that takes a mutex
This commit is contained in:
Andrew Tridgell 2019-04-22 09:29:32 +10:00
parent c63459c237
commit 352546c9f0

View File

@ -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,