From 89366a1ee1faa67faefab19acf5cf7b1dd4e44ff Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 20 Dec 2013 11:59:45 +1100 Subject: [PATCH] Plane: fixed ARMING_REQUIRED=2 on APM2 to disable rc output on throttle --- ArduPlane/GCS_Mavlink.pde | 4 ++++ ArduPlane/radio.pde | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ArduPlane/GCS_Mavlink.pde b/ArduPlane/GCS_Mavlink.pde index b49cb6b3c0..3a273fd6ee 100644 --- a/ArduPlane/GCS_Mavlink.pde +++ b/ArduPlane/GCS_Mavlink.pde @@ -1259,6 +1259,7 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg) // run pre_arm_checks and arm_checks and display failures if (arming.arm(AP_Arming::MAVLINK)) { //only log if arming was successful + channel_throttle->enable_out(); Log_Arm_Disarm(); result = MAV_RESULT_ACCEPTED; } else { @@ -1267,6 +1268,9 @@ void GCS_MAVLINK::handleMessage(mavlink_message_t* msg) } else if (packet.param1 == 0.0f) { if (arming.disarm()) { //only log if disarming was successful + if (arming.arming_required() != AP_Arming::YES_ZERO_PWM) { + channel_throttle->disable_out(); + } Log_Arm_Disarm(); result = MAV_RESULT_ACCEPTED; } else { diff --git a/ArduPlane/radio.pde b/ArduPlane/radio.pde index c2320c5ac1..14735fc1b4 100644 --- a/ArduPlane/radio.pde +++ b/ArduPlane/radio.pde @@ -41,7 +41,9 @@ static void init_rc_out() { channel_roll->enable_out(); channel_pitch->enable_out(); - channel_throttle->enable_out(); + if (arming.arming_required() != AP_Arming::YES_ZERO_PWM) { + channel_throttle->enable_out(); + } channel_rudder->enable_out(); enable_aux_servos(); @@ -105,6 +107,7 @@ static void rudder_arm_check() } else { //time to arm! if (arming.arm(AP_Arming::RUDDER)) { + channel_throttle->enable_out(); //only log if arming was successful Log_Arm_Disarm(); }