Merge pull request #6981 from rav-rav/airmode_fix

fix incorrect throttle offset in airmode
This commit is contained in:
borisbstyle 2018-10-29 09:03:58 +01:00 committed by GitHub
commit eeeec78c2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -846,8 +846,7 @@ FAST_CODE_NOINLINE void mixTable(timeUs_t currentTimeUs, uint8_t vbatPidCompensa
}
} else {
if (airmodeEnabled || throttle > 0.5f) { // Only automatically adjust throttle when airmode enabled. Airmode logic is always active on high throttle
const float throttleLimitOffset = motorMixRange / 2.0f;
throttle = constrainf(throttle, 0.0f + throttleLimitOffset, 1.0f - throttleLimitOffset);
throttle = constrainf(throttle, -motorMixMin, 1.0f - motorMixMax);
}
}