Used PGs rather than parameters for processRcStickPositions
This commit is contained in:
parent
f6c8319361
commit
becdeb4c9b
|
@ -363,7 +363,7 @@ void processRx(timeUs_t currentTimeUs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
processRcStickPositions(rxConfig(), throttleStatus, armingConfig()->disarm_kill_switch);
|
processRcStickPositions(throttleStatus);
|
||||||
|
|
||||||
if (feature(FEATURE_INFLIGHT_ACC_CAL)) {
|
if (feature(FEATURE_INFLIGHT_ACC_CAL)) {
|
||||||
updateInflightCalibrationState();
|
updateInflightCalibrationState();
|
||||||
|
|
|
@ -128,7 +128,7 @@ throttleStatus_e calculateThrottleStatus(void)
|
||||||
return THROTTLE_HIGH;
|
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 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
|
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
|
// checking sticks positions
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
stTmp >>= 2;
|
stTmp >>= 2;
|
||||||
if (rcData[i] > rxConfig->mincheck)
|
if (rcData[i] > rxConfig()->mincheck)
|
||||||
stTmp |= 0x80; // check for MIN
|
stTmp |= 0x80; // check for MIN
|
||||||
if (rcData[i] < rxConfig->maxcheck)
|
if (rcData[i] < rxConfig()->maxcheck)
|
||||||
stTmp |= 0x40; // check for MAX
|
stTmp |= 0x40; // check for MAX
|
||||||
}
|
}
|
||||||
if (stTmp == rcSticks) {
|
if (stTmp == rcSticks) {
|
||||||
|
@ -169,7 +169,7 @@ void processRcStickPositions(const rxConfig_t *rxConfig, throttleStatus_e thrott
|
||||||
if (ARMING_FLAG(ARMED) && rxIsReceivingSignal() && !failsafeIsActive() ) {
|
if (ARMING_FLAG(ARMED) && rxIsReceivingSignal() && !failsafeIsActive() ) {
|
||||||
rcDisarmTicks++;
|
rcDisarmTicks++;
|
||||||
if (rcDisarmTicks > 3) {
|
if (rcDisarmTicks > 3) {
|
||||||
if (disarm_kill_switch) {
|
if (armingConfig()->disarm_kill_switch) {
|
||||||
mwDisarm();
|
mwDisarm();
|
||||||
} else if (throttleStatus == THROTTLE_LOW) {
|
} else if (throttleStatus == THROTTLE_LOW) {
|
||||||
mwDisarm();
|
mwDisarm();
|
||||||
|
@ -681,9 +681,9 @@ void processRcAdjustments(controlRateConfig_t *controlRateConfig, const rxConfig
|
||||||
|
|
||||||
if (adjustmentState->config->mode == ADJUSTMENT_MODE_STEP) {
|
if (adjustmentState->config->mode == ADJUSTMENT_MODE_STEP) {
|
||||||
int delta;
|
int delta;
|
||||||
if (rcData[channelIndex] > rxConfig->midrc + 200) {
|
if (rcData[channelIndex] > rxConfig()->midrc + 200) {
|
||||||
delta = adjustmentState->config->data.stepConfig.step;
|
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;
|
delta = 0 - adjustmentState->config->data.stepConfig.step;
|
||||||
} else {
|
} else {
|
||||||
// returning the switch to the middle immediately resets the ready state
|
// returning the switch to the middle immediately resets the ready state
|
||||||
|
|
|
@ -197,9 +197,8 @@ PG_DECLARE(armingConfig_t, armingConfig);
|
||||||
bool areUsingSticksToArm(void);
|
bool areUsingSticksToArm(void);
|
||||||
|
|
||||||
bool areSticksInApModePosition(uint16_t ap_mode);
|
bool areSticksInApModePosition(uint16_t ap_mode);
|
||||||
struct rxConfig_s;
|
|
||||||
throttleStatus_e calculateThrottleStatus(void);
|
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);
|
bool isRangeActive(uint8_t auxChannelIndex, channelRange_t *range);
|
||||||
void updateActivatedModes(modeActivationCondition_t *modeActivationConditions);
|
void updateActivatedModes(modeActivationCondition_t *modeActivationConditions);
|
||||||
|
@ -295,6 +294,7 @@ typedef struct adjustmentProfile_s {
|
||||||
bool isAirmodeActive(void);
|
bool isAirmodeActive(void);
|
||||||
void resetAdjustmentStates(void);
|
void resetAdjustmentStates(void);
|
||||||
void updateAdjustmentStates(adjustmentRange_t *adjustmentRanges);
|
void updateAdjustmentStates(adjustmentRange_t *adjustmentRanges);
|
||||||
|
struct rxConfig_s;
|
||||||
void processRcAdjustments(controlRateConfig_t *controlRateConfig, const struct rxConfig_s *rxConfig);
|
void processRcAdjustments(controlRateConfig_t *controlRateConfig, const struct rxConfig_s *rxConfig);
|
||||||
|
|
||||||
bool isUsingSticksForArming(void);
|
bool isUsingSticksForArming(void);
|
||||||
|
|
Loading…
Reference in New Issue