Added function buttons configuration to menu

This commit is contained in:
Krzysiek Egzmont
2023-10-17 18:29:12 +02:00
parent 4dd2445833
commit 96144af9e9
5 changed files with 109 additions and 20 deletions

View File

@@ -66,6 +66,11 @@ const t_menu_item MenuList[] =
{"NOAA-S", VOICE_ID_INVALID, MENU_NOAA_S },
#endif
{"F1Shrt", VOICE_ID_INVALID, MENU_F1SHRT },
{"F1Long", VOICE_ID_INVALID, MENU_F1LONG },
{"F2Shrt", VOICE_ID_INVALID, MENU_F2SHRT },
{"F2Long", VOICE_ID_INVALID, MENU_F2LONG },
{"KeyLck", VOICE_ID_INVALID, MENU_AUTOLK }, // was "AUTOLk"
{"TxTOut", VOICE_ID_TRANSMIT_OVER_TIME, MENU_TOT }, // was "TOT"
{"BatSav", VOICE_ID_SAVE_MODE, MENU_SAVE }, // was "SAVE"
@@ -185,10 +190,10 @@ const char gSubMenu_TOT[11][7] =
const char* gSubMenu_RXMode[4] =
{
"MAIN\nONLY", // TX and RX on main only
"MAIN\nONLY", // TX and RX on main only
"DUAL RX\nRESPOND", // Watch both and respond
"CROSS\nBAND", // TX on main, RX on secondary
"MAIN TX\nDUAL RX" // always TX on main, but RX on both
"CROSS\nBAND", // TX on main, RX on secondary
"MAIN TX\nDUAL RX" // always TX on main, but RX on both
};
#ifdef ENABLE_VOICE
@@ -248,7 +253,7 @@ const char gSubMenu_PONMSG[4][8] =
"NONE"
};
const char gSubMenu_ROGER[3][9] =
const char* gSubMenu_ROGER[3] =
{
"OFF",
"ROGER",
@@ -323,6 +328,30 @@ const char gSubMenu_SCRAMBLER[11][7] =
"3500Hz"
};
const t_sidefunction SIDEFUNCTIONS[] =
{
{"NONE", ACTION_OPT_NONE},
{"FLASH\nLIGHT", ACTION_OPT_FLASHLIGHT},
{"POWER", ACTION_OPT_POWER},
{"MONITOR", ACTION_OPT_MONITOR},
{"SCAN", ACTION_OPT_SCAN},
#ifdef ENABLE_VOX
{"VOX", ACTION_OPT_VOX},
#endif
#ifdef ENABLE_ALARM
{"ALARM", ACTION_OPT_ALARM},
#endif
#ifdef ENABLE_FMRADIO
{"FM RADIO", ACTION_OPT_FM},
#endif
#ifdef ENABLE_TX1750
{"1750HZ", ACTION_OPT_1750},
#endif
};
const t_sidefunction* gSubMenu_SIDEFUNCTIONS = SIDEFUNCTIONS;
const uint8_t gSubMenu_SIDEFUNCTIONS_size = ARRAY_SIZE(SIDEFUNCTIONS);
bool gIsInSubMenu;
uint8_t gMenuCursor;
int GetCurrentMenuId() {
@@ -798,6 +827,14 @@ void UI_DisplayMenu(void)
sprintf(String, "%u.%02uV\n%u", vol / 100, vol % 100, gSubMenuSelection);
break;
}
case MENU_F1SHRT:
case MENU_F1LONG:
case MENU_F2SHRT:
case MENU_F2LONG:
strcpy(String, gSubMenu_SIDEFUNCTIONS[gSubMenuSelection].name);
break;
}
if (!already_printed)

View File

@@ -102,9 +102,6 @@ enum
MENU_NOAA_S,
#endif
MENU_RESET,
// items after here are normally hidden
MENU_F_LOCK,
MENU_200TX,
MENU_350TX,
@@ -116,7 +113,11 @@ enum
#ifdef ENABLE_F_CAL_MENU
MENU_F_CALI, // reference xtal calibration
#endif
MENU_BATCAL // battery voltage calibration
MENU_BATCAL, // battery voltage calibration
MENU_F1SHRT,
MENU_F1LONG,
MENU_F2SHRT,
MENU_F2LONG
};
extern const uint8_t FIRST_HIDDEN_MENU_ITEM;
@@ -141,7 +142,7 @@ extern const char* gSubMenu_MDF[4];
extern const char gSubMenu_D_RSP[4][11];
extern const char* gSubMenu_PTT_ID[5];
extern const char gSubMenu_PONMSG[4][8];
extern const char gSubMenu_ROGER[3][9];
extern const char* gSubMenu_ROGER[3];
extern const char gSubMenu_RESET[2][4];
extern const char gSubMenu_F_LOCK[6][4];
extern const char gSubMenu_BACKLIGHT[8][7];
@@ -152,6 +153,10 @@ extern const char gSubMenu_RX_TX[4][6];
extern const char gSubMenu_BAT_TXT[3][8];
extern const char gSubMenu_SCRAMBLER[11][7];
typedef struct {char* name; uint8_t id;} t_sidefunction;
extern const uint8_t gSubMenu_SIDEFUNCTIONS_size;
extern const t_sidefunction* gSubMenu_SIDEFUNCTIONS;
extern bool gIsInSubMenu;