From 7fc61090f24e64b1b4f8457514be05e50e8da861 Mon Sep 17 00:00:00 2001 From: Andy Piper Date: Fri, 30 Aug 2024 15:06:06 +0100 Subject: [PATCH] AP_HAL_ChibiOS: add support for disabled mask on iomcu --- libraries/AP_HAL_ChibiOS/RCOutput.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/RCOutput.cpp b/libraries/AP_HAL_ChibiOS/RCOutput.cpp index 0d51df06c5..8a5be5e440 100644 --- a/libraries/AP_HAL_ChibiOS/RCOutput.cpp +++ b/libraries/AP_HAL_ChibiOS/RCOutput.cpp @@ -650,6 +650,11 @@ uint32_t RCOutput::get_disabled_channels(uint32_t digital_mask) } disabled_chan_mask <<= chan_offset; +#if HAL_WITH_IO_MCU + if (iomcu_dshot) { + disabled_chan_mask |= iomcu.get_disabled_channels(digital_mask); + } +#endif return disabled_chan_mask; } @@ -1463,9 +1468,9 @@ void RCOutput::dshot_send_groups(rcout_timer_t cycle_start_us, rcout_timer_t tim } for (auto &group : pwm_group_list) { - bool pulse_sent; + bool pulse_sent = false; // send a dshot command - if (is_dshot_protocol(group.current_mode) + if (group.can_send_dshot_pulse() && dshot_command_is_active(group)) { command_sent = dshot_send_command(group, _dshot_current_command.command, _dshot_current_command.chan); pulse_sent = true;