Fix Profile selection Bug MSP and rc_controls.c warnings

This commit is contained in:
borisbstyle 2016-02-05 23:00:23 +01:00
parent 36de2bbc23
commit 9f15da0641
2 changed files with 3 additions and 3 deletions

View File

@ -724,8 +724,8 @@ void processRcAdjustments(controlRateConfig_t *controlRateConfig, rxConfig_t *rx
applyStepAdjustment(controlRateConfig, adjustmentFunction, delta); applyStepAdjustment(controlRateConfig, adjustmentFunction, delta);
} else if (adjustmentState->config->mode == ADJUSTMENT_MODE_SELECT) { } else if (adjustmentState->config->mode == ADJUSTMENT_MODE_SELECT) {
uint16_t rangeWidth = ((2100 - 900) / adjustmentState->config->data.selectConfig.switchPositions); //uint16_t rangeWidth = ((2100 - 900) / adjustmentState->config->data.selectConfig.switchPositions); TODO - cleanup
uint8_t position = (constrain(rcData[channelIndex], 900, 2100 - 1) - 900) / rangeWidth; //uint8_t position = (constrain(rcData[channelIndex], 900, 2100 - 1) - 900) / rangeWidth; TODO - cleanup
// applySelectAdjustment(adjustmentFunction, position); // applySelectAdjustment(adjustmentFunction, position);
} }

View File

@ -1213,7 +1213,7 @@ static bool processInCommand(void)
case MSP_SELECT_SETTING: case MSP_SELECT_SETTING:
if (!ARMING_FLAG(ARMED)) { if (!ARMING_FLAG(ARMED)) {
masterConfig.current_profile_index = read8(); masterConfig.current_profile_index = read8();
if (masterConfig.current_profile_index > 2) { if (masterConfig.current_profile_index > 1) {
masterConfig.current_profile_index = 0; masterConfig.current_profile_index = 0;
} }
writeEEPROM(); writeEEPROM();