From cfef1e1135d0026e46fb7359528e84513f6fa933 Mon Sep 17 00:00:00 2001 From: lbullard-c2 <125946006+lbullard-c2@users.noreply.github.com> Date: Fri, 25 Oct 2024 11:22:30 +1100 Subject: [PATCH] AP_PiccoloCAN: Allow ESCs to listen to fixed wing throttle channel --- libraries/AP_PiccoloCAN/AP_PiccoloCAN.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libraries/AP_PiccoloCAN/AP_PiccoloCAN.cpp b/libraries/AP_PiccoloCAN/AP_PiccoloCAN.cpp index 54c5453bfb0c0..fdf0355af964e 100644 --- a/libraries/AP_PiccoloCAN/AP_PiccoloCAN.cpp +++ b/libraries/AP_PiccoloCAN/AP_PiccoloCAN.cpp @@ -344,6 +344,14 @@ void AP_PiccoloCAN::update() if (is_esc_channel_active(ii)) { uint16_t output = 0; + + if (SRV_Channels::channel_function(ii) == SRV_Channel::k_throttle) { + SRV_Channels::get_output_pwm(SRV_Channel::k_throttle, output); + _escs[ii].command = output; + _escs[ii].newCommand = true; + break; + } + SRV_Channel::Aux_servo_function_t motor_function = SRV_Channels::get_motor_function(ii); @@ -670,7 +678,7 @@ bool AP_PiccoloCAN::is_esc_channel_active(uint8_t chan) // Check if a motor function is assigned for this motor channel SRV_Channel::Aux_servo_function_t motor_function = SRV_Channels::get_motor_function(chan); - if (SRV_Channels::function_assigned(motor_function)) { + if (SRV_Channels::function_assigned(motor_function) || SRV_Channels::channel_function(chan) == SRV_Channel::k_throttle) { return true; }