Reset adjustment states when switching profiles.

Fixes #544.
This commit is contained in:
Dominic Clifton 2015-02-26 13:57:22 +00:00
parent 05b1b5a9b2
commit 55d9994ff8
3 changed files with 9 additions and 0 deletions

View File

@ -620,6 +620,8 @@ void activateConfig(void)
activateControlRateConfig();
resetAdjustmentStates();
useRcControlsConfig(
currentProfile->modeActivationConditions,
&masterConfig.escAndServoConfig,

View File

@ -593,3 +593,9 @@ void useRcControlsConfig(modeActivationCondition_t *modeActivationConditions, es
}
}
}
void resetAdjustmentStates(void)
{
memset(adjustmentStates, 0, sizeof(adjustmentStates));
}

View File

@ -214,6 +214,7 @@ typedef struct adjustmentState_s {
#define MAX_ADJUSTMENT_RANGE_COUNT 12 // enough for 2 * 6pos switches.
void resetAdjustmentStates(void);
void configureAdjustment(uint8_t index, uint8_t auxChannelIndex, const adjustmentConfig_t *adjustmentConfig);
void updateAdjustmentStates(adjustmentRange_t *adjustmentRanges);
void processRcAdjustments(controlRateConfig_t *controlRateConfig, rxConfig_t *rxConfig);