Browse Source

HAL_ChibiOS: fixed assert in reboot

with asserts enabled we can't sleep with interrupts off
mission-4.1.18
Andrew Tridgell 7 years ago
parent
commit
dbe0f3c575
  1. 3
      libraries/AP_HAL_ChibiOS/Scheduler.cpp

3
libraries/AP_HAL_ChibiOS/Scheduler.cpp

@ -249,7 +249,8 @@ void Scheduler::reboot(bool hold_in_bootloader) @@ -249,7 +249,8 @@ void Scheduler::reboot(bool hold_in_bootloader)
disable_interrupts_save();
// wait for 1ms to ensure all pending DMAs are complete
delay_microseconds(1000);
uint32_t start_us = AP_HAL::micros();
while (AP_HAL::micros() - start_us < 1000) ; // busy loop
// reboot
NVIC_SystemReset();

Loading…
Cancel
Save