From 8d5b9521ad3386de4415a2cd6965026261d5c3f9 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 31 Oct 2018 11:05:45 +1100 Subject: [PATCH] AP_Arming: added IOMCU health check --- libraries/AP_Arming/AP_Arming.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libraries/AP_Arming/AP_Arming.cpp b/libraries/AP_Arming/AP_Arming.cpp index a0f674b8d3..4df8f2a585 100644 --- a/libraries/AP_Arming/AP_Arming.cpp +++ b/libraries/AP_Arming/AP_Arming.cpp @@ -79,6 +79,11 @@ const AP_Param::GroupInfo AP_Arming::var_info[] = { AP_GROUPEND }; +#if HAL_WITH_IO_MCU +#include +extern AP_IOMCU iomcu; +#endif + AP_Arming::AP_Arming() { AP_Param::setup_object_defaults(this, var_info); @@ -508,6 +513,13 @@ bool AP_Arming::servo_checks(bool report) const } } +#if HAL_WITH_IO_MCU + if (!iomcu.healthy()) { + check_failed(ARMING_CHECK_NONE, report, "IOMCU is unhealthy"); + check_passed = false; + } +#endif + return check_passed; }