From e93888dee9f32f7f0486fa227ba09f729672c71d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 8 Mar 2013 14:59:19 +1100 Subject: [PATCH] Plane: make a throttle_cruise of 0 mean always zero throttle this can be used for parachute landing missions Thanks to Chris Miser for the suggestion --- ArduPlane/Attitude.pde | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ArduPlane/Attitude.pde b/ArduPlane/Attitude.pde index f288473f5d..b5422702fc 100644 --- a/ArduPlane/Attitude.pde +++ b/ArduPlane/Attitude.pde @@ -231,6 +231,14 @@ static void crash_checker() static void calc_throttle() { + if (g.throttle_cruise <= 1) { + // user has asked for zero throttle - this may be done by a + // mission which wants to turn off the engine for a parachute + // landing + g.channel_throttle.servo_out = 0; + return; + } + if (!alt_control_airspeed()) { int16_t throttle_target = g.throttle_cruise + throttle_nudge;