Skip to content

Commit

Permalink
AP_PiccoloCAN: Allow ESCs to listen to fixed wing throttle channel
Browse files Browse the repository at this point in the history
  • Loading branch information
lbullard-c2 authored Oct 25, 2024
1 parent 72f0ecc commit cfef1e1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion libraries/AP_PiccoloCAN/AP_PiccoloCAN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit cfef1e1

Please sign in to comment.