diff --git a/src/main/fc/fc_core.c b/src/main/fc/fc_core.c index fb91d4d4a..270ee1b59 100644 --- a/src/main/fc/fc_core.c +++ b/src/main/fc/fc_core.c @@ -363,7 +363,7 @@ void processRx(timeUs_t currentTimeUs) } } - processRcStickPositions(rxConfig(), throttleStatus, armingConfig()->disarm_kill_switch); + processRcStickPositions(throttleStatus); if (feature(FEATURE_INFLIGHT_ACC_CAL)) { updateInflightCalibrationState(); diff --git a/src/main/fc/rc_controls.c b/src/main/fc/rc_controls.c index 9181a0a53..4ce3c96d1 100644 --- a/src/main/fc/rc_controls.c +++ b/src/main/fc/rc_controls.c @@ -128,7 +128,7 @@ throttleStatus_e calculateThrottleStatus(void) return THROTTLE_HIGH; } -void processRcStickPositions(const rxConfig_t *rxConfig, throttleStatus_e throttleStatus, bool disarm_kill_switch) +void processRcStickPositions(throttleStatus_e throttleStatus) { static uint8_t rcDelayCommand; // this indicates the number of time (multiple of RC measurement at 50Hz) the sticks must be maintained to run or switch off motors static uint8_t rcSticks; // this hold sticks position for command combos @@ -140,9 +140,9 @@ void processRcStickPositions(const rxConfig_t *rxConfig, throttleStatus_e thrott // checking sticks positions for (i = 0; i < 4; i++) { stTmp >>= 2; - if (rcData[i] > rxConfig->mincheck) + if (rcData[i] > rxConfig()->mincheck) stTmp |= 0x80; // check for MIN - if (rcData[i] < rxConfig->maxcheck) + if (rcData[i] < rxConfig()->maxcheck) stTmp |= 0x40; // check for MAX } if (stTmp == rcSticks) { @@ -169,7 +169,7 @@ void processRcStickPositions(const rxConfig_t *rxConfig, throttleStatus_e thrott if (ARMING_FLAG(ARMED) && rxIsReceivingSignal() && !failsafeIsActive() ) { rcDisarmTicks++; if (rcDisarmTicks > 3) { - if (disarm_kill_switch) { + if (armingConfig()->disarm_kill_switch) { mwDisarm(); } else if (throttleStatus == THROTTLE_LOW) { mwDisarm(); @@ -681,9 +681,9 @@ void processRcAdjustments(controlRateConfig_t *controlRateConfig, const rxConfig if (adjustmentState->config->mode == ADJUSTMENT_MODE_STEP) { int delta; - if (rcData[channelIndex] > rxConfig->midrc + 200) { + if (rcData[channelIndex] > rxConfig()->midrc + 200) { delta = adjustmentState->config->data.stepConfig.step; - } else if (rcData[channelIndex] < rxConfig->midrc - 200) { + } else if (rcData[channelIndex] < rxConfig()->midrc - 200) { delta = 0 - adjustmentState->config->data.stepConfig.step; } else { // returning the switch to the middle immediately resets the ready state diff --git a/src/main/fc/rc_controls.h b/src/main/fc/rc_controls.h index 928564daa..864c4ec43 100644 --- a/src/main/fc/rc_controls.h +++ b/src/main/fc/rc_controls.h @@ -197,9 +197,8 @@ PG_DECLARE(armingConfig_t, armingConfig); bool areUsingSticksToArm(void); bool areSticksInApModePosition(uint16_t ap_mode); -struct rxConfig_s; throttleStatus_e calculateThrottleStatus(void); -void processRcStickPositions(const struct rxConfig_s *rxConfig, throttleStatus_e throttleStatus, bool disarm_kill_switch); +void processRcStickPositions(throttleStatus_e throttleStatus); bool isRangeActive(uint8_t auxChannelIndex, channelRange_t *range); void updateActivatedModes(modeActivationCondition_t *modeActivationConditions); @@ -295,6 +294,7 @@ typedef struct adjustmentProfile_s { bool isAirmodeActive(void); void resetAdjustmentStates(void); void updateAdjustmentStates(adjustmentRange_t *adjustmentRanges); +struct rxConfig_s; void processRcAdjustments(controlRateConfig_t *controlRateConfig, const struct rxConfig_s *rxConfig); bool isUsingSticksForArming(void);