mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-17 13:25:30 +03:00
Fixes from review.
This commit is contained in:
parent
817bb2ed86
commit
feaa082ac3
4 changed files with 9 additions and 8 deletions
|
@ -712,7 +712,6 @@ static void applyMixToMotors(float motorMix[MAX_SUPPORTED_MOTORS])
|
|||
} else {
|
||||
motorOutput = constrain(motorOutput, motorRangeMin, motorRangeMax);
|
||||
}
|
||||
|
||||
motor[i] = motorOutput;
|
||||
}
|
||||
|
||||
|
@ -786,10 +785,12 @@ FAST_CODE_NOINLINE void mixTable(timeUs_t currentTimeUs, uint8_t vbatPidCompensa
|
|||
throttle = applyThrottleLimit(throttle);
|
||||
}
|
||||
|
||||
const bool airmodeEnabled = airmodeIsEnabled();
|
||||
|
||||
#ifdef USE_YAW_SPIN_RECOVERY
|
||||
// 50% throttle provides the maximum authority for yaw recovery when airmode is not active.
|
||||
// When airmode is active the throttle setting doesn't impact recovery authority.
|
||||
if (yawSpinDetected && !airmodeIsEnabled()) {
|
||||
if (yawSpinDetected && !airmodeEnabled) {
|
||||
throttle = 0.5f; //
|
||||
}
|
||||
#endif // USE_YAW_SPIN_RECOVERY
|
||||
|
@ -836,11 +837,11 @@ FAST_CODE_NOINLINE void mixTable(timeUs_t currentTimeUs, uint8_t vbatPidCompensa
|
|||
motorMix[i] /= motorMixRange;
|
||||
}
|
||||
// Get the maximum correction by setting offset to center when airmode enabled
|
||||
if (airmodeIsEnabled()) {
|
||||
if (airmodeEnabled) {
|
||||
throttle = 0.5f;
|
||||
}
|
||||
} else {
|
||||
if (airmodeIsEnabled() || throttle > 0.5f) { // Only automatically adjust throttle when airmode enabled. Airmode logic is always active on high throttle
|
||||
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);
|
||||
}
|
||||
|
@ -849,7 +850,7 @@ FAST_CODE_NOINLINE void mixTable(timeUs_t currentTimeUs, uint8_t vbatPidCompensa
|
|||
if (featureIsEnabled(FEATURE_MOTOR_STOP)
|
||||
&& ARMING_FLAG(ARMED)
|
||||
&& !featureIsEnabled(FEATURE_3D)
|
||||
&& !isAirmodeActive()
|
||||
&& !airmodeEnabled
|
||||
&& (rcData[THROTTLE] < rxConfig()->mincheck)) {
|
||||
// motor_stop handling
|
||||
applyMotorStop();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue