diff --git a/src/main/config/config.c b/src/main/config/config.c index b489ff3bd..ee1bfca7e 100644 --- a/src/main/config/config.c +++ b/src/main/config/config.c @@ -620,6 +620,8 @@ void activateConfig(void) activateControlRateConfig(); + resetAdjustmentStates(); + useRcControlsConfig( currentProfile->modeActivationConditions, &masterConfig.escAndServoConfig, diff --git a/src/main/io/rc_controls.c b/src/main/io/rc_controls.c index 01ade6bc8..e14683dc0 100644 --- a/src/main/io/rc_controls.c +++ b/src/main/io/rc_controls.c @@ -593,3 +593,9 @@ void useRcControlsConfig(modeActivationCondition_t *modeActivationConditions, es } } } + +void resetAdjustmentStates(void) +{ + memset(adjustmentStates, 0, sizeof(adjustmentStates)); +} + diff --git a/src/main/io/rc_controls.h b/src/main/io/rc_controls.h index dde0536f0..a1549f5c5 100644 --- a/src/main/io/rc_controls.h +++ b/src/main/io/rc_controls.h @@ -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);