HAL_ChibiOS: shutdown IOMCU on reboot

This commit is contained in:
Andrew Tridgell 2018-10-30 08:51:37 +11:00
parent ed48c24600
commit 6c761fa864

View File

@ -36,6 +36,11 @@
#include "shared_dma.h"
#include "sdcard.h"
#if HAL_WITH_IO_MCU
#include <AP_IOMCU/AP_IOMCU.h>
extern AP_IOMCU iomcu;
#endif
using namespace ChibiOS;
extern const AP_HAL::HAL& hal;
@ -225,6 +230,12 @@ void Scheduler::reboot(bool hold_in_bootloader)
// disarm motors to ensure they are off during a bootloader upload
hal.rcout->force_safety_on();
#if HAL_WITH_IO_MCU
if (AP_BoardConfig::io_enabled()) {
iomcu.shutdown();
}
#endif
#ifndef NO_DATAFLASH
//stop logging
DataFlash_Class::instance()->StopLogging();