mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 14:25:20 +03:00
Calculate maxThrottleDifference before use.
* Easier to understand. * Reduces code size by 32 bytes.
This commit is contained in:
parent
4e6a268eb5
commit
78b52c53d5
1 changed files with 7 additions and 4 deletions
|
@ -731,11 +731,14 @@ void mixTable(void)
|
|||
}
|
||||
}
|
||||
|
||||
int16_t maxThrottleDifference = 0;
|
||||
if (maxMotor > escAndServoConfig->maxthrottle) {
|
||||
maxThrottleDifference = maxMotor - escAndServoConfig->maxthrottle;
|
||||
}
|
||||
|
||||
for (i = 0; i < motorCount; i++) {
|
||||
if (maxMotor > escAndServoConfig->maxthrottle) {
|
||||
// this is a way to still have good gyro corrections if at least one motor reaches its max.
|
||||
motor[i] -= maxMotor - escAndServoConfig->maxthrottle;
|
||||
}
|
||||
// this is a way to still have good gyro corrections if at least one motor reaches its max.
|
||||
motor[i] -= maxThrottleDifference;
|
||||
|
||||
if (feature(FEATURE_3D)) {
|
||||
if ((rcData[THROTTLE]) > rxConfig->midrc) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue