mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 12:25:20 +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();
|
||||
|
|
|
@ -972,7 +972,7 @@ extern "C" {
|
|||
return false;
|
||||
}
|
||||
|
||||
bool isAirmodeActive() {
|
||||
bool airmodeIsEnabled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -278,7 +278,7 @@ extern "C" {
|
|||
|
||||
bool featureIsEnabled(uint32_t) {return false;}
|
||||
|
||||
bool isAirmodeActive(void) {return true;}
|
||||
bool airmodeIsEnabled(void) {return true;}
|
||||
|
||||
mspResult_e mspFcProcessCommand(mspPacket_t *cmd, mspPacket_t *reply, mspPostProcessFnPtr *mspPostProcessFn) {
|
||||
|
||||
|
|
|
@ -312,7 +312,7 @@ bool telemetryCheckRxPortShared(const serialPortConfig_t *) {return true;}
|
|||
|
||||
portSharing_e determinePortSharing(const serialPortConfig_t *, serialPortFunction_e) {return PORTSHARING_NOT_SHARED;}
|
||||
|
||||
bool isAirmodeActive(void) {return airMode;}
|
||||
bool airmodeIsEnabled(void) {return airMode;}
|
||||
|
||||
int32_t getAmperage(void) {
|
||||
return testAmperage;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue