ui/menu.c: Simplify code; move name printing into main switch statement.

This saves a few bytes of flash.
This commit is contained in:
Wouter van Gulik
2023-12-28 21:31:42 +13:00
committed by Krzysiek Egzmont
parent fbdaf6631d
commit 429cffc0bc

View File

@@ -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;
}
@@ -929,16 +931,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);
char *pPrintStr = s[0] ? s : "--";
UI_PrintString(pPrintStr, 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);