Browse Source

AP_Periph: removed PWM count check for servos

actuator IDs are tied to OUTn_FUNCTION, not to physical output IDs, so
it is perfectly possible for an actuator ID to be larger than the
number of PWM outputs on the board
gps-1.3.1
Andrew Tridgell 3 years ago
parent
commit
62b03bd1f1
  1. 5
      Tools/AP_Periph/rc_out.cpp

5
Tools/AP_Periph/rc_out.cpp

@ -88,11 +88,6 @@ void AP_Periph_FW::rcout_esc(int16_t *rc, uint8_t num_channels) @@ -88,11 +88,6 @@ void AP_Periph_FW::rcout_esc(int16_t *rc, uint8_t num_channels)
void AP_Periph_FW::rcout_srv(uint8_t actuator_id, const float command_value)
{
#if HAL_PWM_COUNT > 0
if ((actuator_id == 0) || (actuator_id > HAL_PWM_COUNT)) {
// not supported or out of range
return;
}
const SRV_Channel::Aux_servo_function_t function = SRV_Channel::Aux_servo_function_t(SRV_Channel::k_rcin1 + actuator_id - 1);
SRV_Channels::set_output_norm(function, command_value);

Loading…
Cancel
Save