1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 17:25:20 +03:00

Unified warning activation conditions.

This commit is contained in:
mikeller 2018-11-03 17:37:18 +13:00
parent 99eab92200
commit 286f21150c
6 changed files with 17 additions and 8 deletions

View file

@ -483,7 +483,7 @@ static bool osdDrawSingleElement(uint8_t item)
{
const int angleR = attitude.values.roll / 10;
const int angleP = attitude.values.pitch / 10; // still gotta update all angleR and angleP pointers.
if (IS_RC_MODE_ACTIVE(BOXFLIPOVERAFTERCRASH)) {
if (isFlipOverAfterCrashMode()) {
if (angleP > 0 && ((angleR > 175 && angleR < 180) || (angleR > -180 && angleR < -175))) {
buff[0] = SYM_ARROW_SOUTH;
} else if (angleP > 0 && angleR > 0 && angleR < 175) {
@ -946,7 +946,7 @@ static bool osdDrawSingleElement(uint8_t item)
#endif
// Warn when in flip over after crash mode
if (osdWarnGetState(OSD_WARNING_CRASH_FLIP) && IS_RC_MODE_ACTIVE(BOXFLIPOVERAFTERCRASH)) {
if (osdWarnGetState(OSD_WARNING_CRASH_FLIP) && isFlipOverAfterCrashWarningActive()) {
osdFormatMessage(buff, OSD_FORMAT_MESSAGE_BUFFER_SIZE, "CRASH FLIP");
break;
}