mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-10 18:24:11 +01:00
When the systemmod callback happens exit if the operation is error or completed
This commit is contained in:
parent
27ad0fcf6f
commit
3eb41d3ef2
@ -219,6 +219,12 @@ static void objectUpdatedCb(UAVObjEvent * ev)
|
|||||||
FlightStatusData flightStatus;
|
FlightStatusData flightStatus;
|
||||||
FlightStatusGet(&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
|
// Execute action if disarmed
|
||||||
if(flightStatus.Armed != FLIGHTSTATUS_ARMED_DISARMED) {
|
if(flightStatus.Armed != FLIGHTSTATUS_ARMED_DISARMED) {
|
||||||
retval = -1;
|
retval = -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user