1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 08:45:36 +03:00

Added 'crash flip active' to the list of warnings to be shown on LED_STRIP.

This commit is contained in:
mikeller 2018-11-02 01:48:06 +13:00
parent 0fae0a49c5
commit 99eab92200
2 changed files with 16 additions and 6 deletions

View file

@ -524,6 +524,7 @@ typedef enum {
WARNING_ARMING_DISABLED,
WARNING_LOW_BATTERY,
WARNING_FAILSAFE,
WARNING_CRASH_FLIP_ACTIVE,
} warningFlags_e;
static void applyLedWarningLayer(bool updateNow, timeUs_t *timer)
@ -538,12 +539,18 @@ static void applyLedWarningLayer(bool updateNow, timeUs_t *timer)
if (warningFlashCounter == 0) { // update when old flags was processed
warningFlags = 0;
if (batteryConfig()->voltageMeterSource != VOLTAGE_METER_NONE && getBatteryState() != BATTERY_OK)
if (batteryConfig()->voltageMeterSource != VOLTAGE_METER_NONE && getBatteryState() != BATTERY_OK) {
warningFlags |= 1 << WARNING_LOW_BATTERY;
if (failsafeIsActive())
}
if (failsafeIsActive()) {
warningFlags |= 1 << WARNING_FAILSAFE;
if (!ARMING_FLAG(ARMED) && isArmingDisabled())
}
if (!ARMING_FLAG(ARMED) && isArmingDisabled()) {
warningFlags |= 1 << WARNING_ARMING_DISABLED;
}
if (IS_RC_MODE_ACTIVE(BOXFLIPOVERAFTERCRASH)) {
warningFlags |= 1 << WARNING_CRASH_FLIP_ACTIVE;
}
}
*timer += HZ_TO_US(10);
}
@ -556,10 +563,13 @@ static void applyLedWarningLayer(bool updateNow, timeUs_t *timer)
if (warningFlags & (1 << warningId)) {
switch (warningId) {
case WARNING_ARMING_DISABLED:
warningColor = colorOn ? &HSV(GREEN) : &HSV(BLACK);
warningColor = colorOn ? &HSV(GREEN) : &HSV(BLACK);
break;
case WARNING_CRASH_FLIP_ACTIVE:
warningColor = colorOn ? &HSV(MAGENTA) : &HSV(BLACK);
break;
case WARNING_LOW_BATTERY:
warningColor = colorOn ? &HSV(RED) : &HSV(BLACK);
warningColor = colorOn ? &HSV(RED) : &HSV(BLACK);
break;
case WARNING_FAILSAFE:
warningColor = colorOn ? &HSV(YELLOW) : &HSV(BLUE);