@@ -101,18 +101,18 @@ bool areSticksDeflectedMoreThanPosHoldDeadband(void)
101
101
throttleStatus_e calculateThrottleStatus (void )
102
102
{
103
103
const uint16_t deadband3d_throttle = rcControlsConfig ()-> deadband3d_throttle ;
104
- if (feature (FEATURE_3D ) && (rcData [ THROTTLE ] > (PWM_RANGE_MIDDLE - deadband3d_throttle ) && rcData [ THROTTLE ] < (PWM_RANGE_MIDDLE + deadband3d_throttle )))
104
+ if (feature (FEATURE_3D ) && (rxGetChannelValue ( THROTTLE ) > (PWM_RANGE_MIDDLE - deadband3d_throttle ) && rxGetChannelValue ( THROTTLE ) < (PWM_RANGE_MIDDLE + deadband3d_throttle )))
105
105
return THROTTLE_LOW ;
106
- else if (!feature (FEATURE_3D ) && (rcData [ THROTTLE ] < rxConfig ()-> mincheck ))
106
+ else if (!feature (FEATURE_3D ) && (rxGetChannelValue ( THROTTLE ) < rxConfig ()-> mincheck ))
107
107
return THROTTLE_LOW ;
108
108
109
109
return THROTTLE_HIGH ;
110
110
}
111
111
112
112
rollPitchStatus_e calculateRollPitchCenterStatus (void )
113
113
{
114
- if (((rcData [ PITCH ] < (PWM_RANGE_MIDDLE + AIRMODE_DEADBAND )) && (rcData [ PITCH ] > (PWM_RANGE_MIDDLE - AIRMODE_DEADBAND )))
115
- && ((rcData [ ROLL ] < (PWM_RANGE_MIDDLE + AIRMODE_DEADBAND )) && (rcData [ ROLL ] > (PWM_RANGE_MIDDLE - AIRMODE_DEADBAND ))))
114
+ if (((rxGetChannelValue ( PITCH ) < (PWM_RANGE_MIDDLE + AIRMODE_DEADBAND )) && (rxGetChannelValue ( PITCH ) > (PWM_RANGE_MIDDLE - AIRMODE_DEADBAND )))
115
+ && ((rxGetChannelValue ( ROLL ) < (PWM_RANGE_MIDDLE + AIRMODE_DEADBAND )) && (rxGetChannelValue ( ROLL ) > (PWM_RANGE_MIDDLE - AIRMODE_DEADBAND ))))
116
116
return CENTERED ;
117
117
118
118
return NOT_CENTERED ;
@@ -139,17 +139,17 @@ static void updateRcStickPositions(void)
139
139
{
140
140
stickPositions_e tmp = 0 ;
141
141
142
- tmp |= ((rcData [ ROLL ] > rxConfig ()-> mincheck ) ? 0x02 : 0x00 ) << (ROLL * 2 );
143
- tmp |= ((rcData [ ROLL ] < rxConfig ()-> maxcheck ) ? 0x01 : 0x00 ) << (ROLL * 2 );
142
+ tmp |= ((rxGetChannelValue ( ROLL ) > rxConfig ()-> mincheck ) ? 0x02 : 0x00 ) << (ROLL * 2 );
143
+ tmp |= ((rxGetChannelValue ( ROLL ) < rxConfig ()-> maxcheck ) ? 0x01 : 0x00 ) << (ROLL * 2 );
144
144
145
- tmp |= ((rcData [ PITCH ] > rxConfig ()-> mincheck ) ? 0x02 : 0x00 ) << (PITCH * 2 );
146
- tmp |= ((rcData [ PITCH ] < rxConfig ()-> maxcheck ) ? 0x01 : 0x00 ) << (PITCH * 2 );
145
+ tmp |= ((rxGetChannelValue ( PITCH ) > rxConfig ()-> mincheck ) ? 0x02 : 0x00 ) << (PITCH * 2 );
146
+ tmp |= ((rxGetChannelValue ( PITCH ) < rxConfig ()-> maxcheck ) ? 0x01 : 0x00 ) << (PITCH * 2 );
147
147
148
- tmp |= ((rcData [ YAW ] > rxConfig ()-> mincheck ) ? 0x02 : 0x00 ) << (YAW * 2 );
149
- tmp |= ((rcData [ YAW ] < rxConfig ()-> maxcheck ) ? 0x01 : 0x00 ) << (YAW * 2 );
148
+ tmp |= ((rxGetChannelValue ( YAW ) > rxConfig ()-> mincheck ) ? 0x02 : 0x00 ) << (YAW * 2 );
149
+ tmp |= ((rxGetChannelValue ( YAW ) < rxConfig ()-> maxcheck ) ? 0x01 : 0x00 ) << (YAW * 2 );
150
150
151
- tmp |= ((rcData [ THROTTLE ] > rxConfig ()-> mincheck ) ? 0x02 : 0x00 ) << (THROTTLE * 2 );
152
- tmp |= ((rcData [ THROTTLE ] < rxConfig ()-> maxcheck ) ? 0x01 : 0x00 ) << (THROTTLE * 2 );
151
+ tmp |= ((rxGetChannelValue ( THROTTLE ) > rxConfig ()-> mincheck ) ? 0x02 : 0x00 ) << (THROTTLE * 2 );
152
+ tmp |= ((rxGetChannelValue ( THROTTLE ) < rxConfig ()-> maxcheck ) ? 0x01 : 0x00 ) << (THROTTLE * 2 );
153
153
154
154
rcStickPositions = tmp ;
155
155
}
@@ -350,5 +350,5 @@ void processRcStickPositions(throttleStatus_e throttleStatus)
350
350
}
351
351
352
352
int32_t getRcStickDeflection (int32_t axis ) {
353
- return MIN (ABS (rcData [ axis ] - PWM_RANGE_MIDDLE ), 500 );
353
+ return MIN (ABS (rxGetChannelValue ( axis ) - PWM_RANGE_MIDDLE ), 500 );
354
354
}
0 commit comments