1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-19 09:54:15 +01:00

Merge branch 'OP-488_NeverHaltWhileArmed_James'

This commit is contained in:
James Cotton 2011-05-14 17:21:05 -05:00
commit b01e897e36

View File

@ -30,6 +30,7 @@
#include "openpilot.h"
#include "firmwareiap.h"
#include "firmwareiapobj.h"
#include "flightstatus.h"
// Private constants
#define IAP_CMD_STEP_1 1122
@ -156,6 +157,16 @@ static void FirmwareIAPCallback(UAVObjEvent* ev)
case IAP_STATE_STEP_2:
if( data.Command == IAP_CMD_STEP_3 ) {
if( delta > iap_time_3_low_end && delta < iap_time_3_high_end ) {
FlightStatusData flightStatus;
FlightStatusGet(&flightStatus);
if(flightStatus.Armed != FLIGHTSTATUS_ARMED_DISARMED) {
// Abort any attempts if not disarmed
iap_state = IAP_STATE_READY;
break;
}
// we've met the three sequence of command numbers
// we've met the time requirements.
PIOS_IAP_SetRequest1();