@@ -177,25 +177,23 @@ void processRcStickPositions(throttleStatus_e throttleStatus)
177
177
rcSticks = stTmp ;
178
178
179
179
// perform actions
180
- if (!isUsingSticksForArming ()) {
181
- if (IS_RC_MODE_ACTIVE (BOXARM )) {
182
- rcDisarmTimeMs = currentTimeMs ;
183
- tryArm ();
184
- } else {
185
- // Disarming via ARM BOX
186
- // Don't disarm via switch if failsafe is active or receiver doesn't receive data - we can't trust receiver
187
- // and can't afford to risk disarming in the air
188
- if (ARMING_FLAG (ARMED ) && !IS_RC_MODE_ACTIVE (BOXFAILSAFE ) && rxIsReceivingSignal () && !failsafeIsActive ()) {
189
- const timeMs_t disarmDelay = currentTimeMs - rcDisarmTimeMs ;
190
- if (disarmDelay > armingConfig ()-> switchDisarmDelayMs ) {
191
- if (armingConfig ()-> disarm_kill_switch || (throttleStatus == THROTTLE_LOW )) {
192
- disarm (DISARM_SWITCH );
193
- }
180
+ if (IS_RC_MODE_ACTIVE (BOXARM )) {
181
+ rcDisarmTimeMs = currentTimeMs ;
182
+ tryArm ();
183
+ } else {
184
+ // Disarming via ARM BOX
185
+ // Don't disarm via switch if failsafe is active or receiver doesn't receive data - we can't trust receiver
186
+ // and can't afford to risk disarming in the air
187
+ if (ARMING_FLAG (ARMED ) && !IS_RC_MODE_ACTIVE (BOXFAILSAFE ) && rxIsReceivingSignal () && !failsafeIsActive ()) {
188
+ const timeMs_t disarmDelay = currentTimeMs - rcDisarmTimeMs ;
189
+ if (disarmDelay > armingConfig ()-> switchDisarmDelayMs ) {
190
+ if (armingConfig ()-> disarm_kill_switch || (throttleStatus == THROTTLE_LOW )) {
191
+ disarm (DISARM_SWITCH );
194
192
}
195
193
}
196
- else {
197
- rcDisarmTimeMs = currentTimeMs ;
198
- }
194
+ }
195
+ else {
196
+ rcDisarmTimeMs = currentTimeMs ;
199
197
}
200
198
}
201
199
@@ -208,23 +206,6 @@ void processRcStickPositions(throttleStatus_e throttleStatus)
208
206
return ;
209
207
}
210
208
211
- if (isUsingSticksForArming ()) {
212
- // Disarm on throttle down + yaw
213
- if (rcSticks == THR_LO + YAW_LO + PIT_CE + ROL_CE ) {
214
- // Dont disarm if fixedwing and motorstop
215
- if (STATE (FIXED_WING ) && feature (FEATURE_MOTOR_STOP ) && armingConfig ()-> fixed_wing_auto_arm ) {
216
- return ;
217
- }
218
- else if (ARMING_FLAG (ARMED )) {
219
- disarm (DISARM_STICKS );
220
- }
221
- else {
222
- beeper (BEEPER_DISARM_REPEAT ); // sound tone while stick held
223
- rcDelayCommand = 0 ; // reset so disarm tone will repeat
224
- }
225
- }
226
- }
227
-
228
209
if (ARMING_FLAG (ARMED )) {
229
210
// actions during armed
230
211
return ;
@@ -294,40 +275,18 @@ void processRcStickPositions(throttleStatus_e throttleStatus)
294
275
saveConfigAndNotify ();
295
276
}
296
277
297
-
298
- // Arming by sticks
299
- if (isUsingSticksForArming ()) {
300
- if (STATE (FIXED_WING ) && feature (FEATURE_MOTOR_STOP ) && armingConfig ()-> fixed_wing_auto_arm ) {
301
- // Auto arm on throttle when using fixedwing and motorstop
302
- if (throttleStatus != THROTTLE_LOW ) {
303
- tryArm ();
304
- return ;
305
- }
306
- }
307
- else {
308
- if (rcSticks == THR_LO + YAW_HI + PIT_CE + ROL_CE ) {
309
- // Arm via YAW
310
- tryArm ();
311
- return ;
312
- }
313
- }
314
- }
315
-
316
-
317
278
// Calibrating Acc
318
279
if (rcSticks == THR_HI + YAW_LO + PIT_LO + ROL_CE ) {
319
280
accStartCalibration ();
320
281
return ;
321
282
}
322
283
323
-
324
284
// Calibrating Mag
325
285
if (rcSticks == THR_HI + YAW_HI + PIT_LO + ROL_CE ) {
326
286
ENABLE_STATE (CALIBRATE_MAG );
327
287
return ;
328
288
}
329
289
330
-
331
290
// Accelerometer Trim
332
291
if (rcSticks == THR_HI + YAW_CE + PIT_HI + ROL_CE ) {
333
292
applyAndSaveBoardAlignmentDelta (0 , -2 );
0 commit comments