1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-23 16:25:26 +03:00

Restore OSD SW

It is nice to be able to be able to hide the OSD without wasting an OSD
layout
This commit is contained in:
Michel Pastor 2018-05-31 01:12:44 +02:00
parent 5c76229981
commit dd86a0b12f
3 changed files with 11 additions and 1 deletions

View file

@ -57,6 +57,7 @@ static const box_t boxes[CHECKBOX_ITEM_COUNT + 1] = {
{ BOXBEEPERON, "BEEPER", 13 }, { BOXBEEPERON, "BEEPER", 13 },
{ BOXLEDLOW, "LEDLOW", 15 }, { BOXLEDLOW, "LEDLOW", 15 },
{ BOXLIGHTS, "LIGHTS", 16 }, { BOXLIGHTS, "LIGHTS", 16 },
{ BOXOSD, "OSD SW", 19 },
{ BOXTELEMETRY, "TELEMETRY", 20 }, { BOXTELEMETRY, "TELEMETRY", 20 },
{ BOXAUTOTUNE, "AUTO TUNE", 21 }, { BOXAUTOTUNE, "AUTO TUNE", 21 },
{ BOXBLACKBOX, "BLACKBOX", 26 }, { BOXBLACKBOX, "BLACKBOX", 26 },
@ -221,6 +222,8 @@ void initActiveBoxIds(void)
} }
#endif #endif
activeBoxIds[activeBoxIdCount++] = BOXOSD;
#ifdef USE_TELEMETRY #ifdef USE_TELEMETRY
if (feature(FEATURE_TELEMETRY) && telemetryConfig()->telemetry_switch) if (feature(FEATURE_TELEMETRY) && telemetryConfig()->telemetry_switch)
activeBoxIds[activeBoxIdCount++] = BOXTELEMETRY; activeBoxIds[activeBoxIdCount++] = BOXTELEMETRY;
@ -275,6 +278,7 @@ void packBoxModeFlags(boxBitmask_t * mspBoxModeFlags)
CHECK_ACTIVE_BOX(IS_ENABLED(IS_RC_MODE_ACTIVE(BOXBEEPERON)), BOXBEEPERON); CHECK_ACTIVE_BOX(IS_ENABLED(IS_RC_MODE_ACTIVE(BOXBEEPERON)), BOXBEEPERON);
CHECK_ACTIVE_BOX(IS_ENABLED(IS_RC_MODE_ACTIVE(BOXLEDLOW)), BOXLEDLOW); CHECK_ACTIVE_BOX(IS_ENABLED(IS_RC_MODE_ACTIVE(BOXLEDLOW)), BOXLEDLOW);
CHECK_ACTIVE_BOX(IS_ENABLED(IS_RC_MODE_ACTIVE(BOXLIGHTS)), BOXLIGHTS); CHECK_ACTIVE_BOX(IS_ENABLED(IS_RC_MODE_ACTIVE(BOXLIGHTS)), BOXLIGHTS);
CHECK_ACTIVE_BOX(IS_ENABLED(IS_RC_MODE_ACTIVE(BOXOSD)), BOXOSD);
CHECK_ACTIVE_BOX(IS_ENABLED(IS_RC_MODE_ACTIVE(BOXTELEMETRY)), BOXTELEMETRY); CHECK_ACTIVE_BOX(IS_ENABLED(IS_RC_MODE_ACTIVE(BOXTELEMETRY)), BOXTELEMETRY);
CHECK_ACTIVE_BOX(IS_ENABLED(ARMING_FLAG(ARMED)), BOXARM); CHECK_ACTIVE_BOX(IS_ENABLED(ARMING_FLAG(ARMED)), BOXARM);
CHECK_ACTIVE_BOX(IS_ENABLED(IS_RC_MODE_ACTIVE(BOXBLACKBOX)), BOXBLACKBOX); CHECK_ACTIVE_BOX(IS_ENABLED(IS_RC_MODE_ACTIVE(BOXBLACKBOX)), BOXBLACKBOX);

View file

@ -39,7 +39,7 @@ typedef enum {
BOXLEDLOW = 12, BOXLEDLOW = 12,
BOXLIGHTS = 13, BOXLIGHTS = 13,
BOXNAVLAUNCH = 14, BOXNAVLAUNCH = 14,
// BOXOSD = 15, BOXOSD = 15,
BOXTELEMETRY = 16, BOXTELEMETRY = 16,
BOXBLACKBOX = 17, BOXBLACKBOX = 17,
BOXFAILSAFE = 18, BOXFAILSAFE = 18,

View file

@ -2224,6 +2224,12 @@ static void osdRefresh(timeUs_t currentTimeUs)
{ {
static timeUs_t lastTimeUs = 0; static timeUs_t lastTimeUs = 0;
if (IS_RC_MODE_ACTIVE(BOXOSD) && (!cmsInMenu)) {
displayClearScreen(osdDisplayPort);
armState = ARMING_FLAG(ARMED);
return;
}
// detect arm/disarm // detect arm/disarm
if (armState != ARMING_FLAG(ARMED)) { if (armState != ARMING_FLAG(ARMED)) {
if (ARMING_FLAG(ARMED)) { if (ARMING_FLAG(ARMED)) {