Add 'WAS_EVER_ARMED' arming flag
This commit is contained in:
parent
ca0fb6c9cf
commit
c0e01e8d2b
|
@ -21,7 +21,8 @@
|
||||||
typedef enum {
|
typedef enum {
|
||||||
OK_TO_ARM = (1 << 0),
|
OK_TO_ARM = (1 << 0),
|
||||||
PREVENT_ARMING = (1 << 1),
|
PREVENT_ARMING = (1 << 1),
|
||||||
ARMED = (1 << 2)
|
ARMED = (1 << 2),
|
||||||
|
WAS_EVER_ARMED = (1 << 3)
|
||||||
} armingFlag_e;
|
} armingFlag_e;
|
||||||
|
|
||||||
extern uint8_t armingFlags;
|
extern uint8_t armingFlags;
|
||||||
|
|
|
@ -172,8 +172,8 @@ void failsafeUpdateState(void)
|
||||||
bool failsafeSwitchIsOn = IS_RC_MODE_ACTIVE(BOXFAILSAFE);
|
bool failsafeSwitchIsOn = IS_RC_MODE_ACTIVE(BOXFAILSAFE);
|
||||||
beeperMode_e beeperMode = BEEPER_SILENCE;
|
beeperMode_e beeperMode = BEEPER_SILENCE;
|
||||||
|
|
||||||
// Beep RX lost only if we are not seeing data, but we have seen it in the past.
|
// Beep RX lost only if we are not seeing data and we have been armed earlier
|
||||||
if (!receivingRxData && failsafeState.validRxDataReceivedAt) {
|
if (!receivingRxData && ARMING_FLAG(WAS_EVER_ARMED)) {
|
||||||
beeperMode = BEEPER_RX_LOST;
|
beeperMode = BEEPER_RX_LOST;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -366,6 +366,7 @@ void mwArm(void)
|
||||||
}
|
}
|
||||||
if (!ARMING_FLAG(PREVENT_ARMING)) {
|
if (!ARMING_FLAG(PREVENT_ARMING)) {
|
||||||
ENABLE_ARMING_FLAG(ARMED);
|
ENABLE_ARMING_FLAG(ARMED);
|
||||||
|
ENABLE_ARMING_FLAG(WAS_EVER_ARMED);
|
||||||
headFreeModeHold = DECIDEGREES_TO_DEGREES(attitude.values.yaw);
|
headFreeModeHold = DECIDEGREES_TO_DEGREES(attitude.values.yaw);
|
||||||
|
|
||||||
#ifdef BLACKBOX
|
#ifdef BLACKBOX
|
||||||
|
|
Loading…
Reference in New Issue