MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / reboot

Method reboot

libraries/AP_HAL_ChibiOS/Scheduler.cpp:288–319  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

286}
287
288void 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
321void Scheduler::_run_timers()
322{

Callers 1

boot_to_dfuMethod · 0.45

Calls 6

get_singletonFunction · 0.85
set_fast_rebootFunction · 0.85
shutdownMethod · 0.80
StopLoggingMethod · 0.80
force_safety_onMethod · 0.45
unmountMethod · 0.45

Tested by

no test coverage detected