| 286 | } |
| 287 | |
| 288 | void Scheduler::reboot(bool hold_in_bootloader) |
| 289 | { |
| 290 | // disarm motors to ensure they are off during a bootloader upload |
| 291 | hal.rcout->force_safety_on(); |
| 292 | |
| 293 | #if HAL_WITH_IO_MCU |
| 294 | if (AP_BoardConfig::io_enabled()) { |
| 295 | iomcu.shutdown(); |
| 296 | } |
| 297 | #endif |
| 298 | |
| 299 | #if HAL_LOGGING_ENABLED |
| 300 | //stop logging |
| 301 | if (AP_Logger::get_singleton()) { |
| 302 | AP::logger().StopLogging(); |
| 303 | } |
| 304 | |
| 305 | // unmount filesystem, if active |
| 306 | AP::FS().unmount(); |
| 307 | #endif |
| 308 | |
| 309 | #if AP_FASTBOOT_ENABLED |
| 310 | // setup RTC for fast reboot |
| 311 | set_fast_reboot(hold_in_bootloader?RTC_BOOT_HOLD:RTC_BOOT_FAST); |
| 312 | #endif |
| 313 | |
| 314 | // disable all interrupt sources |
| 315 | port_disable(); |
| 316 | |
| 317 | // reboot |
| 318 | NVIC_SystemReset(); |
| 319 | } |
| 320 | |
| 321 | void Scheduler::_run_timers() |
| 322 | { |
no test coverage detected