From 27ad0fcf6f95b4c15bad3bed7ec324c6d0be6c4a Mon Sep 17 00:00:00 2001 From: James Cotton Date: Thu, 19 Jul 2012 21:51:31 -0500 Subject: [PATCH] Don't allow the system to save while armed --- flight/Modules/System/systemmod.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/flight/Modules/System/systemmod.c b/flight/Modules/System/systemmod.c index 827b264d2..879c4ac86 100644 --- a/flight/Modules/System/systemmod.c +++ b/flight/Modules/System/systemmod.c @@ -216,8 +216,13 @@ static void objectUpdatedCb(UAVObjEvent * ev) ObjectPersistenceGet(&objper); int retval = 1; - // Execute action - if (objper.Operation == OBJECTPERSISTENCE_OPERATION_LOAD) { + FlightStatusData flightStatus; + FlightStatusGet(&flightStatus); + + // Execute action if disarmed + if(flightStatus.Armed != FLIGHTSTATUS_ARMED_DISARMED) { + retval = -1; + } else if (objper.Operation == OBJECTPERSISTENCE_OPERATION_LOAD) { if (objper.Selection == OBJECTPERSISTENCE_SELECTION_SINGLEOBJECT) { // Get selected object obj = UAVObjGetByID(objper.ObjectID);