mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-20 23:05:19 +03:00
Fix multi-range profile type adjustments (#9162)
Fix multi-range profile type adjustments
This commit is contained in:
commit
ab43b3a1e5
1 changed files with 30 additions and 30 deletions
|
@ -782,14 +782,10 @@ static void processContinuosAdjustments(controlRateConfig_t *controlRateConfig)
|
|||
const adjustmentConfig_t *adjustmentConfig = &defaultAdjustmentConfigs[adjustmentRange->adjustmentConfig - ADJUSTMENT_FUNCTION_CONFIG_INDEX_OFFSET];
|
||||
const adjustmentFunction_e adjustmentFunction = adjustmentConfig->adjustmentFunction;
|
||||
|
||||
if (!isRangeActive(adjustmentRange->auxChannelIndex, &adjustmentRange->range) ||
|
||||
adjustmentFunction == ADJUSTMENT_NONE ||
|
||||
rcData[channelIndex] == adjustmentState->lastRcData) {
|
||||
continue;
|
||||
}
|
||||
|
||||
adjustmentState->lastRcData = rcData[channelIndex];
|
||||
if (isRangeActive(adjustmentRange->auxChannelIndex, &adjustmentRange->range) &&
|
||||
adjustmentFunction != ADJUSTMENT_NONE) {
|
||||
|
||||
if (rcData[channelIndex] != adjustmentState->lastRcData) {
|
||||
int newValue = -1;
|
||||
|
||||
if (adjustmentConfig->mode == ADJUSTMENT_MODE_SELECT) {
|
||||
|
@ -815,12 +811,16 @@ static void processContinuosAdjustments(controlRateConfig_t *controlRateConfig)
|
|||
pidInitConfig(currentPidProfile);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(USE_OSD) && defined(USE_OSD_ADJUSTMENTS)
|
||||
updateOsdAdjustmentData(newValue, adjustmentConfig->adjustmentFunction);
|
||||
#else
|
||||
UNUSED(newValue);
|
||||
#endif
|
||||
adjustmentState->lastRcData = rcData[channelIndex];
|
||||
}
|
||||
} else {
|
||||
adjustmentState->lastRcData = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue