From c3f008c4c3f71ff7945d2d59afac03c3a4d59abf Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 3 Nov 2022 16:33:38 +1100 Subject: [PATCH] HAL_ChibiOS: fixed BRD_SAFETY_MASK on some boards for boards that have an IOMCU but also have a safety button on the FMU this fixes the BRD_SAFETY_MASK --- libraries/AP_HAL_ChibiOS/RCOutput.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libraries/AP_HAL_ChibiOS/RCOutput.cpp b/libraries/AP_HAL_ChibiOS/RCOutput.cpp index 8f217f10d4..d85e59789d 100644 --- a/libraries/AP_HAL_ChibiOS/RCOutput.cpp +++ b/libraries/AP_HAL_ChibiOS/RCOutput.cpp @@ -2092,9 +2092,14 @@ void RCOutput::safety_update(void) } #elif HAL_WITH_IO_MCU safety_state = _safety_switch_state(); - iomcu.set_safety_mask(safety_mask); #endif +#if HAL_WITH_IO_MCU + // regardless of if we have a FMU safety pin, if we have an IOMCU we need + // to pass the BRD_SAFETY_MASK to the IOMCU + iomcu.set_safety_mask(safety_mask); +#endif + #ifdef HAL_GPIO_PIN_LED_SAFETY led_counter = (led_counter+1) % 16; const uint16_t led_pattern = safety_state==AP_HAL::Util::SAFETY_DISARMED?0x5500:0xFFFF;