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