Browse Source

AP_Periph: mark ESC DShot channels as digital

this allows them to get the right default MIN and MAX values on the
channels
apm_2208
Andrew Tridgell 3 years ago
parent
commit
406de11fe9
  1. 8
      Tools/AP_Periph/rc_out.cpp

8
Tools/AP_Periph/rc_out.cpp

@ -59,7 +59,13 @@ void AP_Periph_FW::rcout_init() @@ -59,7 +59,13 @@ void AP_Periph_FW::rcout_init()
}
// setup ESCs with the desired PWM type, allowing for DShot
hal.rcout->set_output_mode(esc_mask, (AP_HAL::RCOutput::output_mode)g.esc_pwm_type.get());
const auto esc_type = (AP_HAL::RCOutput::output_mode)g.esc_pwm_type.get();
hal.rcout->set_output_mode(esc_mask, esc_type);
if (esc_type >= AP_HAL::RCOutput::MODE_PWM_DSHOT150 &&
esc_type <= AP_HAL::RCOutput::MODE_PWM_DSHOT1200) {
SRV_Channels::set_digital_outputs(esc_mask, 0);
}
// run this once and at 1Hz to configure aux and esc ranges
rcout_init_1Hz();

Loading…
Cancel
Save