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)) {
|
||||
tmp = constrain(rcData[THROTTLE], PWM_RANGE_MIN, PWM_RANGE_MAX);
|
||||
tmp = (uint32_t)(tmp - PWM_RANGE_MIN);
|
||||
if (getLowVoltageCutoff()->enabled) {
|
||||
tmp = tmp * getLowVoltageCutoff()->percentage / 100;
|
||||
}
|
||||
} else {
|
||||
tmp = constrain(rcData[THROTTLE], rxConfig()->mincheck, PWM_RANGE_MAX);
|
||||
tmp = (uint32_t)(tmp - rxConfig()->mincheck) * PWM_RANGE_MIN / (PWM_RANGE_MAX - rxConfig()->mincheck);
|
||||
}
|
||||
|
||||
if (getLowVoltageCutoff()->enabled) {
|
||||
tmp = tmp * getLowVoltageCutoff()->percentage / 100;
|
||||
}
|
||||
}
|
||||
|
||||
rcCommand[THROTTLE] = rcLookupThrottle(tmp);
|
||||
|
||||
|
|
Loading…
Reference in New Issue