1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 17:25:20 +03:00

Increased number of rate profiles to 6

This commit is contained in:
Martin Budden 2017-10-09 22:07:55 +01:00
parent ab1812455f
commit 7acebf8b34
5 changed files with 10 additions and 2 deletions

View file

@ -484,7 +484,11 @@ void processRcAdjustments(controlRateConfig_t *controlRateConfig)
newValue = applyStepAdjustment(controlRateConfig, adjustmentFunction, delta);
pidInitConfig(pidProfile);
} else if (adjustmentState->config->mode == ADJUSTMENT_MODE_SELECT) {
const uint16_t rangeWidth = ((2100 - 900) / adjustmentState->config->data.switchPositions);
int switchPositions = adjustmentState->config->data.switchPositions;
if (adjustmentFunction == ADJUSTMENT_RATE_PROFILE && systemConfig()->rateProfile6PosSwitch) {
switchPositions = 6;
}
const uint16_t rangeWidth = (2100 - 900) / switchPositions;
const uint8_t position = (constrain(rcData[channelIndex], 900, 2100 - 1) - 900) / rangeWidth;
newValue = applySelectAdjustment(adjustmentFunction, position);
}