diff --git a/docs/en/config/actuators.md b/docs/en/config/actuators.md index a48a446c7c..448783cc33 100644 --- a/docs/en/config/actuators.md +++ b/docs/en/config/actuators.md @@ -593,7 +593,7 @@ To set this up: 1. Set `Minimum`, `Maximum`, `Trim` and `Disarm` value so that the surface will stay at neutral position approximately. This is usually around `1500` for PWM servos (near the centre of the servo range). -2. Gradualy increate the `Maximum` for each servo, while checking the deflection with the sliders or manual input with [`COM_PREARM_MODE`](../advanced_config/parameter_reference.md#COM_PREARM_MODE) parameter to `Always` until the desired deflection is reached. +2. Gradualy increase the `Maximum` for each servo, while checking the deflection with the sliders or manual input with [`COM_PREARM_MODE`](../advanced_config/parameter_reference.md#COM_PREARM_MODE) parameter to `Always` until the desired deflection is reached. 3. Gradualy decrease the `Minimum` for each servo, until the desired deflection is reached. 4. Set `PWM_MAIN_TRIMx` / `PWM_AUX_TRIMx` to the neutral point of each servo. diff --git a/src/lib/mixer_module/mixer_module.cpp b/src/lib/mixer_module/mixer_module.cpp index b42904d03d..a375704b18 100644 --- a/src/lib/mixer_module/mixer_module.cpp +++ b/src/lib/mixer_module/mixer_module.cpp @@ -190,13 +190,7 @@ void MixingOutput::updateParams() } // Trim needs to be clamped to min/max - if (_trim_value[i] < _min_value[i]) { - _trim_value[i] = _min_value[i]; - } - - if (_trim_value[i] > _max_value[i]) { - _trim_value[i] = _max_value[i]; - } + _trim_value[i] = math::constrain(_trim_value[i], _min_value[i], _max_value[i]); if (_param_handles[i].failsafe != PARAM_INVALID && param_get(_param_handles[i].failsafe, &val) == 0) { _failsafe_value[i] = val;