Skip to content

Commit

Permalink
ui/menu.c: Simplify code; move name printing into main switch statement.
Browse files Browse the repository at this point in the history
This saves a few bytes of flash.
  • Loading branch information
wutje committed Dec 29, 2023
1 parent 9042ebc commit 12f8551
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions ui/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,8 @@ void UI_DisplayMenu(void)
UI_PrintString(String, menu_item_x1, menu_item_x2, 4, 8);
}

SETTINGS_FetchChannelName(String, gSubMenuSelection);
UI_PrintString(String[0] ? String : "--", menu_item_x1, menu_item_x2, 2, 8);
already_printed = true;
break;
}
Expand Down Expand Up @@ -928,15 +930,6 @@ void UI_DisplayMenu(void)
}
}

if (UI_MENU_GetCurrentMenuId() == MENU_MEM_CH ||
UI_MENU_GetCurrentMenuId() == MENU_DEL_CH ||
UI_MENU_GetCurrentMenuId() == MENU_1_CALL)
{ // display the channel name
char s[11];
SETTINGS_FetchChannelName(s, gSubMenuSelection);
UI_PrintString(s[0] ? s : "--", menu_item_x1, menu_item_x2, 2, 8);
}

if ((UI_MENU_GetCurrentMenuId() == MENU_R_CTCS || UI_MENU_GetCurrentMenuId() == MENU_R_DCS) && gCssBackgroundScan)
UI_PrintString("SCAN", menu_item_x1, menu_item_x2, 4, 8);

Expand Down

0 comments on commit 12f8551

Please sign in to comment.