1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-10 18:24:11 +01:00

Don't allow the system to save while armed

This commit is contained in:
James Cotton 2012-07-19 21:51:31 -05:00
parent be892e236d
commit 27ad0fcf6f

View File

@ -216,8 +216,13 @@ static void objectUpdatedCb(UAVObjEvent * ev)
ObjectPersistenceGet(&objper); ObjectPersistenceGet(&objper);
int retval = 1; int retval = 1;
// Execute action FlightStatusData flightStatus;
if (objper.Operation == OBJECTPERSISTENCE_OPERATION_LOAD) { 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) { if (objper.Selection == OBJECTPERSISTENCE_SELECTION_SINGLEOBJECT) {
// Get selected object // Get selected object
obj = UAVObjGetByID(objper.ObjectID); obj = UAVObjGetByID(objper.ObjectID);