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

When the systemmod callback happens exit if the operation is error or completed

This commit is contained in:
James Cotton 2012-07-19 22:18:36 -05:00
parent 27ad0fcf6f
commit 3eb41d3ef2

View File

@ -219,6 +219,12 @@ static void objectUpdatedCb(UAVObjEvent * ev)
FlightStatusData flightStatus;
FlightStatusGet(&flightStatus);
// When this is called because of this method don't do anything
if (objper.Operation == OBJECTPERSISTENCE_OPERATION_ERROR ||
objper.Operation == OBJECTPERSISTENCE_OPERATION_COMPLETED) {
return;
}
// Execute action if disarmed
if(flightStatus.Armed != FLIGHTSTATUS_ARMED_DISARMED) {
retval = -1;