Some memory optimizations

This commit is contained in:
Armel FAUVEAU
2024-10-31 02:29:55 +01:00
parent 04d98e1d98
commit 122b1d2faf
3 changed files with 4 additions and 21 deletions

View File

@@ -309,7 +309,7 @@ int MENU_GetLimits(uint8_t menu_id, int32_t *pMin, int32_t *pMax)
case MENU_SAVE:
//*pMin = 0;
*pMax = ARRAY_SIZE(gSubMenu_SAVE) - 1;
*pMax = 5;
break;
case MENU_MIC:

View File

@@ -209,16 +209,6 @@ const char gSubMenu_OFF_ON[][4] =
"ON"
};
const char gSubMenu_SAVE[][4] =
{
"OFF",
"1:1",
"1:2",
"1:3",
"1:4",
"1:5"
};
const char* const gSubMenu_RXMode[] =
{
"MAIN\nONLY", // TX and RX on main only
@@ -676,10 +666,7 @@ void UI_DisplayMenu(void)
#ifdef ENABLE_VOX
case MENU_VOX:
if (gSubMenuSelection == 0)
strcpy(String, "OFF");
else
sprintf(String, "%d", gSubMenuSelection);
sprintf(String, gSubMenuSelection == 0 ? "OFF" : "%u", gSubMenuSelection);
break;
#endif
@@ -825,7 +812,7 @@ void UI_DisplayMenu(void)
}
case MENU_SAVE:
strcpy(String, gSubMenu_SAVE[gSubMenuSelection]);
sprintf(String, gSubMenuSelection == 0 ? "OFF" : "1:%u", gSubMenuSelection);
break;
case MENU_TDR:
@@ -862,10 +849,7 @@ void UI_DisplayMenu(void)
break;
case MENU_RP_STE:
if (gSubMenuSelection == 0)
strcpy(String, "OFF");
else
sprintf(String, "%d*100ms", gSubMenuSelection);
sprintf(String, gSubMenuSelection == 0 ? "OFF" : "%u*100ms", gSubMenuSelection);
break;
case MENU_S_LIST:

View File

@@ -161,7 +161,6 @@ extern const char gSubMenu_TXP[8][6];
extern const char gSubMenu_SFT_D[3][4];
extern const char gSubMenu_W_N[2][7];
extern const char gSubMenu_OFF_ON[2][4];
extern const char gSubMenu_SAVE[6][4];
extern const char gSubMenu_TOT[11][7];
extern const char* const gSubMenu_RXMode[4];