mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-06 15:51:36 +08:00
drivers/pwm_out: set default failsafe values
This commit is contained in:
@@ -86,6 +86,11 @@ struct pwm_output_values {
|
|||||||
*/
|
*/
|
||||||
#define PWM_MOTOR_OFF 900
|
#define PWM_MOTOR_OFF 900
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default value for a servo stop
|
||||||
|
*/
|
||||||
|
#define PWM_SERVO_STOP 1500
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default minimum PWM in us
|
* Default minimum PWM in us
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -613,6 +613,14 @@ void PWMOut::update_params()
|
|||||||
int32_t pwm_fail_new = _mixing_output.failsafeValue(i);
|
int32_t pwm_fail_new = _mixing_output.failsafeValue(i);
|
||||||
param_set(param_find(str), &pwm_fail_new);
|
param_set(param_find(str), &pwm_fail_new);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if (pwm_default_channel_mask & 1 << i) {
|
||||||
|
_mixing_output.failsafeValue(i) = PWM_MOTOR_OFF;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
_mixing_output.failsafeValue(i) = PWM_SERVO_STOP;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user