From 0c48fe258a12a78b30cd69ad8f0bd6a5d5a8406d Mon Sep 17 00:00:00 2001 From: pip Date: Sun, 20 Feb 2011 19:34:27 +0000 Subject: [PATCH] Changed alarm level checking from WARNING level to ERROR level before allowing arming. git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2822 ebee16cc-31ac-478f-84a7-5cbb03baadba --- flight/Modules/ManualControl/manualcontrol.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/flight/Modules/ManualControl/manualcontrol.c b/flight/Modules/ManualControl/manualcontrol.c index 1a52f7ced..5a34cb9f0 100644 --- a/flight/Modules/ManualControl/manualcontrol.c +++ b/flight/Modules/ManualControl/manualcontrol.c @@ -544,7 +544,7 @@ static uint32_t timeDifferenceMs(portTickType start_time, portTickType end_time) } static bool okToArm(void) -{ // return TRUE if it's OK to arm +{ // return TRUE if it's OK to arm, otherwise return FALSE bool ok = true; @@ -568,11 +568,11 @@ static bool okToArm(void) // Check each alarm for (int i = 0; i < SYSTEMALARMS_ALARM_NUMELEM; i++) { - if (alarms.Alarm[i] >= SYSTEMALARMS_ALARM_WARNING) + if (alarms.Alarm[i] >= SYSTEMALARMS_ALARM_ERROR) { // found an alarm thats set if (i != SYSTEMALARMS_ALARM_GPS && i != SYSTEMALARMS_ALARM_TELEMETRY) { // it's not the gps or telemetry alarm - ok = false; + ok = false; // prevent arming break; } } @@ -586,11 +586,11 @@ static bool okToArm(void) // Check each alarm for (int i = 0; i < SYSTEMALARMS_ALARM_NUMELEM; i++) { - if (alarms.Alarm[i] >= SYSTEMALARMS_ALARM_WARNING) + if (alarms.Alarm[i] >= SYSTEMALARMS_ALARM_ERROR) { // found an alarm thats set if (i != SYSTEMALARMS_ALARM_TELEMETRY) { // it's not the telemetry alarm - ok = false; + ok = false; // prevent arming break; } }