mirror of https://github.com/ArduPilot/ardupilot
Copter: function for mot_pwm checks
This commit is contained in:
parent
ac51e2b02b
commit
f59bbc1c9e
|
@ -471,6 +471,17 @@ int16_t AP_MotorsMulticopter::get_pwm_output_max() const
|
|||
return _throttle_radio_max;
|
||||
}
|
||||
|
||||
// parameter checks for MOT_PWM_MIN/MAX
|
||||
bool AP_MotorsMulticopter::check_mot_pwm_params()
|
||||
{
|
||||
if ((_pwm_min == 0 && _pwm_max !=0) || (_pwm_min != 0 && _pwm_max == 0) ||
|
||||
(_pwm_min < 0 || _pwm_min < 0) || (_pwm_min > _pwm_max))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// set_throttle_range - sets the minimum throttle that will be sent to the engines when they're not off (i.e. to prevents issues with some motors spinning and some not at very low throttle)
|
||||
// also sets throttle channel minimum and maximum pwm
|
||||
void AP_MotorsMulticopter::set_throttle_range(int16_t radio_min, int16_t radio_max)
|
||||
|
|
|
@ -84,6 +84,9 @@ public:
|
|||
int16_t get_pwm_output_min() const;
|
||||
int16_t get_pwm_output_max() const;
|
||||
|
||||
// parameter check for MOT_PWM_MIN/MAX
|
||||
bool check_mot_pwm_params();
|
||||
|
||||
// set thrust compensation callback
|
||||
FUNCTOR_TYPEDEF(thrust_compensation_fn_t, void, float *, uint8_t);
|
||||
void set_thrust_compensation_callback(thrust_compensation_fn_t callback) {
|
||||
|
|
Loading…
Reference in New Issue