From dc2aaa7d5a93eb7c836cd687e62ed9d71fa0dd8c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 6 May 2019 14:39:14 +1000 Subject: [PATCH] Plane: deny reverse thrust in takeoff mode --- ArduPlane/reverse_thrust.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ArduPlane/reverse_thrust.cpp b/ArduPlane/reverse_thrust.cpp index 44ea9d9312..c0c2acd2c8 100644 --- a/ArduPlane/reverse_thrust.cpp +++ b/ArduPlane/reverse_thrust.cpp @@ -71,7 +71,6 @@ bool Plane::allow_reverse_thrust(void) const allow |= (g.use_reverse_thrust & USE_REVERSE_THRUST_RTL); break; case Mode::Number::CIRCLE: - case Mode::Number::TAKEOFF: allow |= (g.use_reverse_thrust & USE_REVERSE_THRUST_CIRCLE); break; case Mode::Number::CRUISE: @@ -84,6 +83,9 @@ bool Plane::allow_reverse_thrust(void) const case Mode::Number::GUIDED: allow |= (g.use_reverse_thrust & USE_REVERSE_THRUST_GUIDED); break; + case Mode::Number::TAKEOFF: + allow = false; + break; default: // all other control_modes are auto_throttle_mode=false. // If we are not controlling throttle, don't limit it. @@ -91,7 +93,8 @@ bool Plane::allow_reverse_thrust(void) const break; } - return allow; + // cope with bitwise ops above + return allow != false; } /*