mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-03 11:24:10 +01:00
OP-488: If the FirmwareIAP receives a halt signal but system is not disarmed
abort the halt.
This commit is contained in:
parent
f904e09353
commit
fdd591b700
@ -30,6 +30,7 @@
|
|||||||
#include "openpilot.h"
|
#include "openpilot.h"
|
||||||
#include "firmwareiap.h"
|
#include "firmwareiap.h"
|
||||||
#include "firmwareiapobj.h"
|
#include "firmwareiapobj.h"
|
||||||
|
#include "flightstatus.h"
|
||||||
|
|
||||||
// Private constants
|
// Private constants
|
||||||
#define IAP_CMD_STEP_1 1122
|
#define IAP_CMD_STEP_1 1122
|
||||||
@ -156,6 +157,16 @@ static void FirmwareIAPCallback(UAVObjEvent* ev)
|
|||||||
case IAP_STATE_STEP_2:
|
case IAP_STATE_STEP_2:
|
||||||
if( data.Command == IAP_CMD_STEP_3 ) {
|
if( data.Command == IAP_CMD_STEP_3 ) {
|
||||||
if( delta > iap_time_3_low_end && delta < iap_time_3_high_end ) {
|
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 three sequence of command numbers
|
||||||
// we've met the time requirements.
|
// we've met the time requirements.
|
||||||
PIOS_IAP_SetRequest1();
|
PIOS_IAP_SetRequest1();
|
||||||
|
Loading…
Reference in New Issue
Block a user