From 1c3fb70ab1203dfe55e14c671c6fea1c9f50d02d Mon Sep 17 00:00:00 2001 From: Alessio Morale Date: Fri, 3 May 2013 01:44:41 +0200 Subject: [PATCH] OP-629 Block arming on all navigation based modes Conflicts: flight/modules/ManualControl/manualcontrol.c --- flight/modules/ManualControl/manualcontrol.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/flight/modules/ManualControl/manualcontrol.c b/flight/modules/ManualControl/manualcontrol.c index fd069b33b..a60614c62 100644 --- a/flight/modules/ManualControl/manualcontrol.c +++ b/flight/modules/ManualControl/manualcontrol.c @@ -916,7 +916,18 @@ static bool okToArm(void) } } - return true; + uint8_t flightMode; + FlightStatusFlightModeGet(&flightMode); + switch(flightMode) { + case FLIGHTSTATUS_FLIGHTMODE_MANUAL: + case FLIGHTSTATUS_FLIGHTMODE_STABILIZED1: + case FLIGHTSTATUS_FLIGHTMODE_STABILIZED2: + case FLIGHTSTATUS_FLIGHTMODE_STABILIZED3: + return true; + default: + return false; + + } } /** * @brief Determine if the aircraft is forced to disarm by an explicit alarm