diff --git a/src/drivers/drv_pwm_output.h b/src/drivers/drv_pwm_output.h index 43721f9cb0..d6096d1f52 100644 --- a/src/drivers/drv_pwm_output.h +++ b/src/drivers/drv_pwm_output.h @@ -86,6 +86,11 @@ struct pwm_output_values { */ #define PWM_MOTOR_OFF 900 +/** + * Default value for a servo stop + */ +#define PWM_SERVO_STOP 1500 + /** * Default minimum PWM in us */ diff --git a/src/drivers/pwm_out/PWMOut.cpp b/src/drivers/pwm_out/PWMOut.cpp index f32f579597..27d1a9ed70 100644 --- a/src/drivers/pwm_out/PWMOut.cpp +++ b/src/drivers/pwm_out/PWMOut.cpp @@ -613,6 +613,14 @@ void PWMOut::update_params() int32_t pwm_fail_new = _mixing_output.failsafeValue(i); 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 {