AP_Motors: force PWM range for DShot to 1000 to 2000

This commit is contained in:
Andrew Tridgell 2018-11-09 21:26:59 +11:00
parent fbcbbb72b1
commit f71013928a

View File

@ -404,6 +404,12 @@ void AP_MotorsMulticopter::set_throttle_range(int16_t radio_min, int16_t radio_m
_throttle_radio_min = radio_min;
_throttle_radio_max = radio_max;
if (_pwm_type >= PWM_TYPE_DSHOT150 && _pwm_type <= PWM_TYPE_DSHOT1200) {
// force PWM range for DShot ESCs
_pwm_min.set(1000);
_pwm_max.set(2000);
}
hal.rcout->set_esc_scaling(get_pwm_output_min(), get_pwm_output_max());
}