From fc7f4d517983547b9b662e55cdb767ce92f4c804 Mon Sep 17 00:00:00 2001 From: oleost Date: Sun, 17 Jul 2016 20:42:10 +0200 Subject: [PATCH] Changed arming procedure for fixedwing. With Fixedwing and motorstop enable it auto arms as soon as throttle as above throttle_low. Also disarming is disabled. (Must cycle power for it to disarm) Without motorstop there is normal disarm/arming procedure. --- src/main/fc/rc_controls.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/main/fc/rc_controls.c b/src/main/fc/rc_controls.c index 71d947c8b..b8aafca70 100644 --- a/src/main/fc/rc_controls.c +++ b/src/main/fc/rc_controls.c @@ -195,17 +195,23 @@ void processRcStickPositions(rxConfig_t *rxConfig, throttleStatus_e throttleStat return; } - if (isUsingSticksToArm) { + if (isUsingSticksToArm) { // Disarm on throttle down + yaw if (rcSticks == THR_LO + YAW_LO + PIT_CE + ROL_CE) { + // Dont disarm if fixedwing and motorstop + if (STATE(FIXED_WING) && feature(FEATURE_MOTOR_STOP)) { + return; + } + else { if (ARMING_FLAG(ARMED)) mwDisarm(); else { beeper(BEEPER_DISARM_REPEAT); // sound tone while stick held rcDelayCommand = 0; // reset so disarm tone will repeat + } } } - } + } if (ARMING_FLAG(ARMED)) { // actions during armed @@ -246,6 +252,16 @@ void processRcStickPositions(rxConfig_t *rxConfig, throttleStatus_e throttleStat } } +// Auto arm on throttle when using fixedwing and motorstop + if (isUsingSticksToArm) { + + if ((!throttleStatus == THROTTLE_LOW) && (STATE(FIXED_WING)) && (feature(FEATURE_MOTOR_STOP))) { + // Arm via YAW + mwArm(); + return; + } + } + if (rcSticks == THR_HI + YAW_LO + PIT_LO + ROL_CE) { // Calibrating Acc accSetCalibrationCycles(CALIBRATING_ACC_CYCLES);