mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
First-cut of a refactored failsafe system.
* fixes issue where indicators would flash when SBus RX entered failsafe mode. * fixes bug where turning off a TX for an SBus RX would instantly disarm when using a switch to arm when the channel went outside the arming range. * introduces failsafe phases to make the system more understandable. * allows the system to ask if rxSignalIsBeing received for all RX systems: PPM/PWM/SerialRX/MSP. Also works when a serial data signal is still being received but the data stream indicates a failsafe condition - e.g. SBus failsafe flags. * failsafe settings are no-longer per-profile. Untested: Sumd/Sumh/XBus/MSP (!) Tested: SBus X8R, Lemon RX Sat, X8R in PWM, Spektrum PPM.
This commit is contained in:
parent
37e551db11
commit
c8c0c85656
14 changed files with 260 additions and 145 deletions
|
@ -661,7 +661,7 @@ void applyLedWarningLayer(uint8_t updateNow)
|
|||
if (feature(FEATURE_VBAT) && calculateBatteryState() != BATTERY_OK) {
|
||||
warningFlags |= WARNING_FLAG_LOW_BATTERY;
|
||||
}
|
||||
if (feature(FEATURE_FAILSAFE) && failsafeHasTimerElapsed()) {
|
||||
if (feature(FEATURE_FAILSAFE) && failsafeIsActive()) {
|
||||
warningFlags |= WARNING_FLAG_FAILSAFE;
|
||||
}
|
||||
if (!ARMING_FLAG(ARMED) && !ARMING_FLAG(OK_TO_ARM)) {
|
||||
|
@ -714,6 +714,9 @@ void applyLedIndicatorLayer(uint8_t indicatorFlashState)
|
|||
const ledConfig_t *ledConfig;
|
||||
static const hsvColor_t *flashColor;
|
||||
|
||||
if (!rxIsReceivingSignal()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (indicatorFlashState == 0) {
|
||||
flashColor = &hsv_orange;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue