Simplified code path in fc_rc. (#5536)
This commit is contained in:
parent
9edce2359a
commit
71cd500b99
|
@ -311,16 +311,14 @@ void updateRcCommands(void)
|
||||||
if (feature(FEATURE_3D)) {
|
if (feature(FEATURE_3D)) {
|
||||||
tmp = constrain(rcData[THROTTLE], PWM_RANGE_MIN, PWM_RANGE_MAX);
|
tmp = constrain(rcData[THROTTLE], PWM_RANGE_MIN, PWM_RANGE_MAX);
|
||||||
tmp = (uint32_t)(tmp - PWM_RANGE_MIN);
|
tmp = (uint32_t)(tmp - PWM_RANGE_MIN);
|
||||||
if (getLowVoltageCutoff()->enabled) {
|
|
||||||
tmp = tmp * getLowVoltageCutoff()->percentage / 100;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
tmp = constrain(rcData[THROTTLE], rxConfig()->mincheck, PWM_RANGE_MAX);
|
tmp = constrain(rcData[THROTTLE], rxConfig()->mincheck, PWM_RANGE_MAX);
|
||||||
tmp = (uint32_t)(tmp - rxConfig()->mincheck) * PWM_RANGE_MIN / (PWM_RANGE_MAX - rxConfig()->mincheck);
|
tmp = (uint32_t)(tmp - rxConfig()->mincheck) * PWM_RANGE_MIN / (PWM_RANGE_MAX - rxConfig()->mincheck);
|
||||||
|
}
|
||||||
|
|
||||||
if (getLowVoltageCutoff()->enabled) {
|
if (getLowVoltageCutoff()->enabled) {
|
||||||
tmp = tmp * getLowVoltageCutoff()->percentage / 100;
|
tmp = tmp * getLowVoltageCutoff()->percentage / 100;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
rcCommand[THROTTLE] = rcLookupThrottle(tmp);
|
rcCommand[THROTTLE] = rcLookupThrottle(tmp);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue