Skip to content

Commit

Permalink
Restore OSD SW
Browse files Browse the repository at this point in the history
It is nice to be able to be able to hide the OSD without wasting an OSD
layout
  • Loading branch information
shellixyz committed May 30, 2018
1 parent 5c76229 commit dd86a0b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/main/fc/fc_msp_box.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ static const box_t boxes[CHECKBOX_ITEM_COUNT + 1] = {
{ BOXBEEPERON, "BEEPER", 13 },
{ BOXLEDLOW, "LEDLOW", 15 },
{ BOXLIGHTS, "LIGHTS", 16 },
{ BOXOSD, "OSD SW", 19 },
{ BOXTELEMETRY, "TELEMETRY", 20 },
{ BOXAUTOTUNE, "AUTO TUNE", 21 },
{ BOXBLACKBOX, "BLACKBOX", 26 },
Expand Down Expand Up @@ -221,6 +222,8 @@ void initActiveBoxIds(void)
}
#endif

activeBoxIds[activeBoxIdCount++] = BOXOSD;

#ifdef USE_TELEMETRY
if (feature(FEATURE_TELEMETRY) && telemetryConfig()->telemetry_switch)
activeBoxIds[activeBoxIdCount++] = BOXTELEMETRY;
Expand Down Expand Up @@ -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(BOXLEDLOW)), BOXLEDLOW);
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(ARMING_FLAG(ARMED)), BOXARM);
CHECK_ACTIVE_BOX(IS_ENABLED(IS_RC_MODE_ACTIVE(BOXBLACKBOX)), BOXBLACKBOX);
Expand Down
2 changes: 1 addition & 1 deletion src/main/fc/rc_modes.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ typedef enum {
BOXLEDLOW = 12,
BOXLIGHTS = 13,
BOXNAVLAUNCH = 14,
// BOXOSD = 15,
BOXOSD = 15,
BOXTELEMETRY = 16,
BOXBLACKBOX = 17,
BOXFAILSAFE = 18,
Expand Down
6 changes: 6 additions & 0 deletions src/main/io/osd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2224,6 +2224,12 @@ static void osdRefresh(timeUs_t currentTimeUs)
{
static timeUs_t lastTimeUs = 0;

if (IS_RC_MODE_ACTIVE(BOXOSD) && (!cmsInMenu)) {
displayClearScreen(osdDisplayPort);
armState = ARMING_FLAG(ARMED);
return;
}

// detect arm/disarm
if (armState != ARMING_FLAG(ARMED)) {
if (ARMING_FLAG(ARMED)) {
Expand Down

0 comments on commit dd86a0b

Please sign in to comment.