Menu id fix
This commit is contained in:
@@ -1788,7 +1788,7 @@ void APP_TimeSlice500ms(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (gBacklightCountdown > 0 && !gAskToSave && gCssScanMode == CSS_SCAN_MODE_OFF)
|
if (gBacklightCountdown > 0 && !gAskToSave && gCssScanMode == CSS_SCAN_MODE_OFF)
|
||||||
if (gScreenToDisplay != DISPLAY_MENU || gMenuCursor != MENU_ABR) // don't turn off backlight if user is in backlight menu option
|
if (gScreenToDisplay != DISPLAY_MENU || GetCurrentMenuId() != MENU_ABR) // don't turn off backlight if user is in backlight menu option
|
||||||
if (--gBacklightCountdown == 0)
|
if (--gBacklightCountdown == 0)
|
||||||
if (gEeprom.BACKLIGHT < (ARRAY_SIZE(gSubMenu_BACKLIGHT) - 1))
|
if (gEeprom.BACKLIGHT < (ARRAY_SIZE(gSubMenu_BACKLIGHT) - 1))
|
||||||
GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); // turn backlight off
|
GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); // turn backlight off
|
||||||
|
72
app/menu.c
72
app/menu.c
@@ -98,9 +98,9 @@ void MENU_StopCssScan(void)
|
|||||||
RADIO_SetupRegisters(true);
|
RADIO_SetupRegisters(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)
|
int MENU_GetLimits(uint8_t menu_id, int32_t *pMin, int32_t *pMax)
|
||||||
{
|
{
|
||||||
switch (Cursor)
|
switch (menu_id)
|
||||||
{
|
{
|
||||||
case MENU_SQL:
|
case MENU_SQL:
|
||||||
*pMin = 0;
|
*pMin = 0;
|
||||||
@@ -340,14 +340,14 @@ void MENU_AcceptSetting(void)
|
|||||||
uint8_t Code;
|
uint8_t Code;
|
||||||
FREQ_Config_t *pConfig = &gTxVfo->freq_config_RX;
|
FREQ_Config_t *pConfig = &gTxVfo->freq_config_RX;
|
||||||
|
|
||||||
if (!MENU_GetLimits(gMenuCursor, &Min, &Max))
|
if (!MENU_GetLimits(GetCurrentMenuId(), &Min, &Max))
|
||||||
{
|
{
|
||||||
if (gSubMenuSelection < Min) gSubMenuSelection = Min;
|
if (gSubMenuSelection < Min) gSubMenuSelection = Min;
|
||||||
else
|
else
|
||||||
if (gSubMenuSelection > Max) gSubMenuSelection = Max;
|
if (gSubMenuSelection > Max) gSubMenuSelection = Max;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (gMenuCursor)
|
switch (GetCurrentMenuId())
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
@@ -775,18 +775,17 @@ void MENU_SelectNextCode(void)
|
|||||||
{
|
{
|
||||||
int32_t UpperLimit;
|
int32_t UpperLimit;
|
||||||
|
|
||||||
if (gMenuCursor == MENU_R_DCS)
|
if (GetCurrentMenuId() == MENU_R_DCS)
|
||||||
UpperLimit = 208;
|
UpperLimit = 208;
|
||||||
//UpperLimit = ARRAY_SIZE(DCS_Options);
|
//UpperLimit = ARRAY_SIZE(DCS_Options);
|
||||||
else
|
else if (GetCurrentMenuId() == MENU_R_CTCS)
|
||||||
if (gMenuCursor == MENU_R_CTCS)
|
|
||||||
UpperLimit = ARRAY_SIZE(CTCSS_Options) - 1;
|
UpperLimit = ARRAY_SIZE(CTCSS_Options) - 1;
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gSubMenuSelection = NUMBER_AddWithWraparound(gSubMenuSelection, gMenuScrollDirection, 1, UpperLimit);
|
gSubMenuSelection = NUMBER_AddWithWraparound(gSubMenuSelection, gMenuScrollDirection, 1, UpperLimit);
|
||||||
|
|
||||||
if (gMenuCursor == MENU_R_DCS)
|
if (GetCurrentMenuId() == MENU_R_DCS)
|
||||||
{
|
{
|
||||||
if (gSubMenuSelection > 104)
|
if (gSubMenuSelection > 104)
|
||||||
{
|
{
|
||||||
@@ -818,7 +817,7 @@ static void MENU_ClampSelection(int8_t Direction)
|
|||||||
int32_t Min;
|
int32_t Min;
|
||||||
int32_t Max;
|
int32_t Max;
|
||||||
|
|
||||||
if (!MENU_GetLimits(gMenuCursor, &Min, &Max))
|
if (!MENU_GetLimits(GetCurrentMenuId(), &Min, &Max))
|
||||||
{
|
{
|
||||||
int32_t Selection = gSubMenuSelection;
|
int32_t Selection = gSubMenuSelection;
|
||||||
if (Selection < Min) Selection = Min;
|
if (Selection < Min) Selection = Min;
|
||||||
@@ -830,7 +829,7 @@ static void MENU_ClampSelection(int8_t Direction)
|
|||||||
|
|
||||||
void MENU_ShowCurrentSetting(void)
|
void MENU_ShowCurrentSetting(void)
|
||||||
{
|
{
|
||||||
switch (gMenuCursor)
|
switch (GetCurrentMenuId())
|
||||||
{
|
{
|
||||||
case MENU_SQL:
|
case MENU_SQL:
|
||||||
gSubMenuSelection = gEeprom.SQUELCH_LEVEL;
|
gSubMenuSelection = gEeprom.SQUELCH_LEVEL;
|
||||||
@@ -1150,7 +1149,7 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
|||||||
|
|
||||||
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
||||||
|
|
||||||
if (gMenuCursor == MENU_MEM_NAME && edit_index >= 0)
|
if (GetCurrentMenuId() == MENU_MEM_NAME && edit_index >= 0)
|
||||||
{ // currently editing the channel name
|
{ // currently editing the channel name
|
||||||
|
|
||||||
if (edit_index < 10)
|
if (edit_index < 10)
|
||||||
@@ -1220,7 +1219,7 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gMenuCursor == MENU_OFFSET)
|
if (GetCurrentMenuId() == MENU_OFFSET)
|
||||||
{
|
{
|
||||||
uint32_t Frequency;
|
uint32_t Frequency;
|
||||||
|
|
||||||
@@ -1243,7 +1242,10 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gMenuCursor == MENU_MEM_CH || gMenuCursor == MENU_DEL_CH || gMenuCursor == MENU_1_CALL || gMenuCursor == MENU_MEM_NAME)
|
if (GetCurrentMenuId() == MENU_MEM_CH ||
|
||||||
|
GetCurrentMenuId() == MENU_DEL_CH ||
|
||||||
|
GetCurrentMenuId() == MENU_1_CALL ||
|
||||||
|
GetCurrentMenuId() == MENU_MEM_NAME)
|
||||||
{ // enter 3-digit channel number
|
{ // enter 3-digit channel number
|
||||||
|
|
||||||
if (gInputBoxIndex < 3)
|
if (gInputBoxIndex < 3)
|
||||||
@@ -1272,7 +1274,7 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MENU_GetLimits(gMenuCursor, &Min, &Max))
|
if (MENU_GetLimits(GetCurrentMenuId(), &Min, &Max))
|
||||||
{
|
{
|
||||||
gInputBoxIndex = 0;
|
gInputBoxIndex = 0;
|
||||||
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||||
@@ -1317,7 +1319,7 @@ static void MENU_Key_EXIT(bool bKeyPressed, bool bKeyHeld)
|
|||||||
{
|
{
|
||||||
if (gIsInSubMenu)
|
if (gIsInSubMenu)
|
||||||
{
|
{
|
||||||
if (gInputBoxIndex == 0 || gMenuCursor != MENU_OFFSET)
|
if (gInputBoxIndex == 0 || GetCurrentMenuId() != MENU_OFFSET)
|
||||||
{
|
{
|
||||||
gAskForConfirmation = 0;
|
gAskForConfirmation = 0;
|
||||||
gIsInSubMenu = false;
|
gIsInSubMenu = false;
|
||||||
@@ -1374,12 +1376,12 @@ static void MENU_Key_MENU(const bool bKeyPressed, const bool bKeyHeld)
|
|||||||
if (!gIsInSubMenu)
|
if (!gIsInSubMenu)
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_VOICE
|
#ifdef ENABLE_VOICE
|
||||||
if (gMenuCursor != MENU_SCR)
|
if (GetCurrentMenuId() != MENU_SCR)
|
||||||
gAnotherVoiceID = MenuList[gMenuCursor].voice_id;
|
gAnotherVoiceID = MenuList[gMenuCursor].voice_id;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
if (gMenuCursor == MENU_DEL_CH || gMenuCursor == MENU_MEM_NAME)
|
if (GetCurrentMenuId() == MENU_DEL_CH || GetCurrentMenuId() == MENU_MEM_NAME)
|
||||||
if (!RADIO_CheckValidChannel(gSubMenuSelection, false, 0))
|
if (!RADIO_CheckValidChannel(gSubMenuSelection, false, 0))
|
||||||
return; // invalid channel
|
return; // invalid channel
|
||||||
#endif
|
#endif
|
||||||
@@ -1387,7 +1389,7 @@ static void MENU_Key_MENU(const bool bKeyPressed, const bool bKeyHeld)
|
|||||||
gAskForConfirmation = 0;
|
gAskForConfirmation = 0;
|
||||||
gIsInSubMenu = true;
|
gIsInSubMenu = true;
|
||||||
|
|
||||||
// if (gMenuCursor != MENU_D_LIST)
|
// if (GetCurrentMenuId() != MENU_D_LIST)
|
||||||
{
|
{
|
||||||
gInputBoxIndex = 0;
|
gInputBoxIndex = 0;
|
||||||
edit_index = -1;
|
edit_index = -1;
|
||||||
@@ -1396,7 +1398,7 @@ static void MENU_Key_MENU(const bool bKeyPressed, const bool bKeyHeld)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gMenuCursor == MENU_MEM_NAME)
|
if (GetCurrentMenuId() == MENU_MEM_NAME)
|
||||||
{
|
{
|
||||||
if (edit_index < 0)
|
if (edit_index < 0)
|
||||||
{ // enter channel name edit mode
|
{ // enter channel name edit mode
|
||||||
@@ -1443,10 +1445,10 @@ static void MENU_Key_MENU(const bool bKeyPressed, const bool bKeyHeld)
|
|||||||
|
|
||||||
if (gIsInSubMenu)
|
if (gIsInSubMenu)
|
||||||
{
|
{
|
||||||
if (gMenuCursor == MENU_RESET ||
|
if (GetCurrentMenuId() == MENU_RESET ||
|
||||||
gMenuCursor == MENU_MEM_CH ||
|
GetCurrentMenuId() == MENU_MEM_CH ||
|
||||||
gMenuCursor == MENU_DEL_CH ||
|
GetCurrentMenuId() == MENU_DEL_CH ||
|
||||||
gMenuCursor == MENU_MEM_NAME)
|
GetCurrentMenuId() == MENU_MEM_NAME)
|
||||||
{
|
{
|
||||||
switch (gAskForConfirmation)
|
switch (gAskForConfirmation)
|
||||||
{
|
{
|
||||||
@@ -1459,7 +1461,7 @@ static void MENU_Key_MENU(const bool bKeyPressed, const bool bKeyHeld)
|
|||||||
|
|
||||||
UI_DisplayMenu();
|
UI_DisplayMenu();
|
||||||
|
|
||||||
if (gMenuCursor == MENU_RESET)
|
if (GetCurrentMenuId() == MENU_RESET)
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_VOICE
|
#ifdef ENABLE_VOICE
|
||||||
AUDIO_SetVoiceID(0, VOICE_ID_CONFIRM);
|
AUDIO_SetVoiceID(0, VOICE_ID_CONFIRM);
|
||||||
@@ -1494,7 +1496,7 @@ static void MENU_Key_MENU(const bool bKeyPressed, const bool bKeyHeld)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_VOICE
|
#ifdef ENABLE_VOICE
|
||||||
if (gMenuCursor == MENU_SCR)
|
if (GetCurrentMenuId() == MENU_SCR)
|
||||||
gAnotherVoiceID = (gSubMenuSelection == 0) ? VOICE_ID_SCRAMBLER_OFF : VOICE_ID_SCRAMBLER_ON;
|
gAnotherVoiceID = (gSubMenuSelection == 0) ? VOICE_ID_SCRAMBLER_OFF : VOICE_ID_SCRAMBLER_ON;
|
||||||
else
|
else
|
||||||
gAnotherVoiceID = VOICE_ID_CONFIRM;
|
gAnotherVoiceID = VOICE_ID_CONFIRM;
|
||||||
@@ -1510,7 +1512,7 @@ static void MENU_Key_STAR(const bool bKeyPressed, const bool bKeyHeld)
|
|||||||
|
|
||||||
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
||||||
|
|
||||||
if (gMenuCursor == MENU_MEM_NAME && edit_index >= 0)
|
if (GetCurrentMenuId() == MENU_MEM_NAME && edit_index >= 0)
|
||||||
{ // currently editing the channel name
|
{ // currently editing the channel name
|
||||||
|
|
||||||
if (edit_index < 10)
|
if (edit_index < 10)
|
||||||
@@ -1537,7 +1539,7 @@ static void MENU_Key_STAR(const bool bKeyPressed, const bool bKeyHeld)
|
|||||||
if (gRxVfo->AM_mode == 0)
|
if (gRxVfo->AM_mode == 0)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if (gMenuCursor == MENU_R_CTCS || gMenuCursor == MENU_R_DCS)
|
if (GetCurrentMenuId() == MENU_R_CTCS || GetCurrentMenuId() == MENU_R_DCS)
|
||||||
{ // scan CTCSS or DCS to find the tone/code of the incoming signal
|
{ // scan CTCSS or DCS to find the tone/code of the incoming signal
|
||||||
|
|
||||||
if (gCssScanMode == CSS_SCAN_MODE_OFF)
|
if (gCssScanMode == CSS_SCAN_MODE_OFF)
|
||||||
@@ -1572,7 +1574,7 @@ static void MENU_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
|
|||||||
uint8_t Channel;
|
uint8_t Channel;
|
||||||
bool bCheckScanList;
|
bool bCheckScanList;
|
||||||
|
|
||||||
if (gMenuCursor == MENU_MEM_NAME && gIsInSubMenu && edit_index >= 0)
|
if (GetCurrentMenuId() == MENU_MEM_NAME && gIsInSubMenu && edit_index >= 0)
|
||||||
{ // change the character
|
{ // change the character
|
||||||
if (bKeyPressed && edit_index < 10 && Direction != 0)
|
if (bKeyPressed && edit_index < 10 && Direction != 0)
|
||||||
{
|
{
|
||||||
@@ -1624,7 +1626,7 @@ static void MENU_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
|
|||||||
|
|
||||||
gRequestDisplayScreen = DISPLAY_MENU;
|
gRequestDisplayScreen = DISPLAY_MENU;
|
||||||
|
|
||||||
if (gMenuCursor != MENU_ABR && gEeprom.BACKLIGHT == 0)
|
if (GetCurrentMenuId() != MENU_ABR && gEeprom.BACKLIGHT == 0)
|
||||||
{
|
{
|
||||||
gBacklightCountdown = 0;
|
gBacklightCountdown = 0;
|
||||||
GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); // turn the backlight OFF
|
GPIO_ClearBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); // turn the backlight OFF
|
||||||
@@ -1633,7 +1635,7 @@ static void MENU_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gMenuCursor == MENU_OFFSET)
|
if (GetCurrentMenuId() == MENU_OFFSET)
|
||||||
{
|
{
|
||||||
int32_t Offset = (Direction * gTxVfo->StepFrequency) + gSubMenuSelection;
|
int32_t Offset = (Direction * gTxVfo->StepFrequency) + gSubMenuSelection;
|
||||||
if (Offset < 99999990)
|
if (Offset < 99999990)
|
||||||
@@ -1654,7 +1656,7 @@ static void MENU_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
|
|||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough="
|
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough="
|
||||||
|
|
||||||
switch (gMenuCursor)
|
switch (GetCurrentMenuId())
|
||||||
{
|
{
|
||||||
case MENU_DEL_CH:
|
case MENU_DEL_CH:
|
||||||
case MENU_1_CALL:
|
case MENU_1_CALL:
|
||||||
@@ -1715,7 +1717,7 @@ void MENU_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
|||||||
MENU_Key_STAR(bKeyPressed, bKeyHeld);
|
MENU_Key_STAR(bKeyPressed, bKeyHeld);
|
||||||
break;
|
break;
|
||||||
case KEY_F:
|
case KEY_F:
|
||||||
if (gMenuCursor == MENU_MEM_NAME && edit_index >= 0)
|
if (GetCurrentMenuId() == MENU_MEM_NAME && edit_index >= 0)
|
||||||
{ // currently editing the channel name
|
{ // currently editing the channel name
|
||||||
if (!bKeyHeld && bKeyPressed)
|
if (!bKeyHeld && bKeyPressed)
|
||||||
{
|
{
|
||||||
@@ -1747,11 +1749,11 @@ void MENU_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
|||||||
|
|
||||||
if (gScreenToDisplay == DISPLAY_MENU)
|
if (gScreenToDisplay == DISPLAY_MENU)
|
||||||
{
|
{
|
||||||
if (gMenuCursor == MENU_VOL ||
|
if (GetCurrentMenuId() == MENU_VOL ||
|
||||||
#ifdef ENABLE_F_CAL_MENU
|
#ifdef ENABLE_F_CAL_MENU
|
||||||
gMenuCursor == MENU_F_CALI ||
|
GetCurrentMenuId() == MENU_F_CALI ||
|
||||||
#endif
|
#endif
|
||||||
gMenuCursor == MENU_BATCAL)
|
GetCurrentMenuId() == MENU_BATCAL)
|
||||||
{
|
{
|
||||||
gMenuCountdown = menu_timeout_long_500ms;
|
gMenuCountdown = menu_timeout_long_500ms;
|
||||||
}
|
}
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
void writeXtalFreqCal(const int32_t value, const bool update_eeprom);
|
void writeXtalFreqCal(const int32_t value, const bool update_eeprom);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax);
|
int MENU_GetLimits(uint8_t menu_id, int32_t *pMin, int32_t *pMax);
|
||||||
void MENU_AcceptSetting(void);
|
void MENU_AcceptSetting(void);
|
||||||
void MENU_SelectNextCode(void);
|
void MENU_SelectNextCode(void);
|
||||||
void MENU_ShowCurrentSetting(void);
|
void MENU_ShowCurrentSetting(void);
|
||||||
|
@@ -106,7 +106,7 @@ void BATTERY_GetReadings(const bool bDisplayBatteryLevel)
|
|||||||
|
|
||||||
gBatteryVoltageAverage = (Voltage * 760) / gBatteryCalibration[3];
|
gBatteryVoltageAverage = (Voltage * 760) / gBatteryCalibration[3];
|
||||||
|
|
||||||
if ((gScreenToDisplay == DISPLAY_MENU) && gMenuCursor == MENU_VOL)
|
if ((gScreenToDisplay == DISPLAY_MENU) && GetCurrentMenuId() == MENU_VOL)
|
||||||
gUpdateDisplay = true;
|
gUpdateDisplay = true;
|
||||||
|
|
||||||
if (gBatteryCurrent < 501)
|
if (gBatteryCurrent < 501)
|
||||||
|
52
ui/menu.c
52
ui/menu.c
@@ -36,9 +36,7 @@
|
|||||||
#include "ui/menu.h"
|
#include "ui/menu.h"
|
||||||
#include "ui/ui.h"
|
#include "ui/ui.h"
|
||||||
|
|
||||||
// NOTE. this menu list is half way through a change, what might seem
|
|
||||||
// pointless at this time is for there for a reason.
|
|
||||||
//
|
|
||||||
const t_menu_item MenuList[] =
|
const t_menu_item MenuList[] =
|
||||||
{
|
{
|
||||||
// text, voice ID, menu ID
|
// text, voice ID, menu ID
|
||||||
@@ -327,6 +325,12 @@ const char gSubMenu_SCRAMBLER[11][7] =
|
|||||||
|
|
||||||
bool gIsInSubMenu;
|
bool gIsInSubMenu;
|
||||||
uint8_t gMenuCursor;
|
uint8_t gMenuCursor;
|
||||||
|
int GetCurrentMenuId() {
|
||||||
|
if(gMenuCursor < ARRAY_SIZE(MenuList))
|
||||||
|
return MenuList[gMenuCursor].menu_id;
|
||||||
|
else
|
||||||
|
return MenuList[ARRAY_SIZE(MenuList)-1].menu_id;
|
||||||
|
}
|
||||||
int8_t gMenuScrollDirection;
|
int8_t gMenuScrollDirection;
|
||||||
int32_t gSubMenuSelection;
|
int32_t gSubMenuSelection;
|
||||||
|
|
||||||
@@ -433,7 +437,7 @@ void UI_DisplayMenu(void)
|
|||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough="
|
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough="
|
||||||
|
|
||||||
switch (gMenuCursor)
|
switch (GetCurrentMenuId())
|
||||||
{
|
{
|
||||||
case MENU_SQL:
|
case MENU_SQL:
|
||||||
sprintf(String, "%d", gSubMenuSelection);
|
sprintf(String, "%d", gSubMenuSelection);
|
||||||
@@ -476,7 +480,7 @@ void UI_DisplayMenu(void)
|
|||||||
{
|
{
|
||||||
#if 1
|
#if 1
|
||||||
unsigned int Code;
|
unsigned int Code;
|
||||||
FREQ_Config_t *pConfig = (gMenuCursor == MENU_R_CTCS) ? &gTxVfo->freq_config_RX : &gTxVfo->freq_config_TX;
|
FREQ_Config_t *pConfig = (GetCurrentMenuId() == MENU_R_CTCS) ? &gTxVfo->freq_config_RX : &gTxVfo->freq_config_TX;
|
||||||
if (gSubMenuSelection == 0)
|
if (gSubMenuSelection == 0)
|
||||||
{
|
{
|
||||||
strcpy(String, "OFF");
|
strcpy(String, "OFF");
|
||||||
@@ -855,9 +859,9 @@ void UI_DisplayMenu(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gMenuCursor == MENU_SLIST1 || gMenuCursor == MENU_SLIST2)
|
if (GetCurrentMenuId() == MENU_SLIST1 || GetCurrentMenuId() == MENU_SLIST2)
|
||||||
{
|
{
|
||||||
i = (gMenuCursor == MENU_SLIST1) ? 0 : 1;
|
i = (GetCurrentMenuId() == MENU_SLIST1) ? 0 : 1;
|
||||||
|
|
||||||
// if (gSubMenuSelection == 0xFF)
|
// if (gSubMenuSelection == 0xFF)
|
||||||
if (gSubMenuSelection < 0)
|
if (gSubMenuSelection < 0)
|
||||||
@@ -902,9 +906,9 @@ void UI_DisplayMenu(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gMenuCursor == MENU_MEM_CH ||
|
if (GetCurrentMenuId() == MENU_MEM_CH ||
|
||||||
gMenuCursor == MENU_DEL_CH ||
|
GetCurrentMenuId() == MENU_DEL_CH ||
|
||||||
gMenuCursor == MENU_1_CALL)
|
GetCurrentMenuId() == MENU_1_CALL)
|
||||||
{ // display the channel name
|
{ // display the channel name
|
||||||
char s[11];
|
char s[11];
|
||||||
BOARD_fetchChannelName(s, gSubMenuSelection);
|
BOARD_fetchChannelName(s, gSubMenuSelection);
|
||||||
@@ -913,18 +917,18 @@ void UI_DisplayMenu(void)
|
|||||||
UI_PrintString(s, menu_item_x1, menu_item_x2, 2, 8);
|
UI_PrintString(s, menu_item_x1, menu_item_x2, 2, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((gMenuCursor == MENU_R_CTCS || gMenuCursor == MENU_R_DCS) && gCssScanMode != CSS_SCAN_MODE_OFF)
|
if ((GetCurrentMenuId() == MENU_R_CTCS || GetCurrentMenuId() == MENU_R_DCS) && gCssScanMode != CSS_SCAN_MODE_OFF)
|
||||||
UI_PrintString("SCAN", menu_item_x1, menu_item_x2, 4, 8);
|
UI_PrintString("SCAN", menu_item_x1, menu_item_x2, 4, 8);
|
||||||
|
|
||||||
if (gMenuCursor == MENU_UPCODE)
|
if (GetCurrentMenuId() == MENU_UPCODE)
|
||||||
if (strlen(gEeprom.DTMF_UP_CODE) > 8)
|
if (strlen(gEeprom.DTMF_UP_CODE) > 8)
|
||||||
UI_PrintString(gEeprom.DTMF_UP_CODE + 8, menu_item_x1, menu_item_x2, 4, 8);
|
UI_PrintString(gEeprom.DTMF_UP_CODE + 8, menu_item_x1, menu_item_x2, 4, 8);
|
||||||
|
|
||||||
if (gMenuCursor == MENU_DWCODE)
|
if (GetCurrentMenuId() == MENU_DWCODE)
|
||||||
if (strlen(gEeprom.DTMF_DOWN_CODE) > 8)
|
if (strlen(gEeprom.DTMF_DOWN_CODE) > 8)
|
||||||
UI_PrintString(gEeprom.DTMF_DOWN_CODE + 8, menu_item_x1, menu_item_x2, 4, 8);
|
UI_PrintString(gEeprom.DTMF_DOWN_CODE + 8, menu_item_x1, menu_item_x2, 4, 8);
|
||||||
|
|
||||||
if (gMenuCursor == MENU_D_LIST && gIsDtmfContactValid)
|
if (GetCurrentMenuId() == MENU_D_LIST && gIsDtmfContactValid)
|
||||||
{
|
{
|
||||||
Contact[11] = 0;
|
Contact[11] = 0;
|
||||||
memmove(&gDTMF_ID, Contact + 8, 4);
|
memmove(&gDTMF_ID, Contact + 8, 4);
|
||||||
@@ -932,22 +936,22 @@ void UI_DisplayMenu(void)
|
|||||||
UI_PrintString(String, menu_item_x1, menu_item_x2, 4, 8);
|
UI_PrintString(String, menu_item_x1, menu_item_x2, 4, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gMenuCursor == MENU_R_CTCS ||
|
if (GetCurrentMenuId() == MENU_R_CTCS ||
|
||||||
gMenuCursor == MENU_T_CTCS ||
|
GetCurrentMenuId() == MENU_T_CTCS ||
|
||||||
gMenuCursor == MENU_R_DCS ||
|
GetCurrentMenuId() == MENU_R_DCS ||
|
||||||
gMenuCursor == MENU_T_DCS ||
|
GetCurrentMenuId() == MENU_T_DCS ||
|
||||||
gMenuCursor == MENU_D_LIST)
|
GetCurrentMenuId() == MENU_D_LIST)
|
||||||
{
|
{
|
||||||
unsigned int Offset;
|
unsigned int Offset;
|
||||||
NUMBER_ToDigits(gSubMenuSelection, String);
|
NUMBER_ToDigits(gSubMenuSelection, String);
|
||||||
Offset = (gMenuCursor == MENU_D_LIST) ? 2 : 3;
|
Offset = (GetCurrentMenuId() == MENU_D_LIST) ? 2 : 3;
|
||||||
UI_DisplaySmallDigits(Offset, String + (8 - Offset), 105, 0, false);
|
UI_DisplaySmallDigits(Offset, String + (8 - Offset), 105, 0, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((gMenuCursor == MENU_RESET ||
|
if ((GetCurrentMenuId() == MENU_RESET ||
|
||||||
gMenuCursor == MENU_MEM_CH ||
|
GetCurrentMenuId() == MENU_MEM_CH ||
|
||||||
gMenuCursor == MENU_MEM_NAME ||
|
GetCurrentMenuId() == MENU_MEM_NAME ||
|
||||||
gMenuCursor == MENU_DEL_CH) && gAskForConfirmation)
|
GetCurrentMenuId() == MENU_DEL_CH) && gAskForConfirmation)
|
||||||
{ // display confirmation
|
{ // display confirmation
|
||||||
strcpy(String, (gAskForConfirmation == 1) ? "SURE?" : "WAIT!");
|
strcpy(String, (gAskForConfirmation == 1) ? "SURE?" : "WAIT!");
|
||||||
UI_PrintString(String, menu_item_x1, menu_item_x2, 5, 8);
|
UI_PrintString(String, menu_item_x1, menu_item_x2, 5, 8);
|
||||||
|
@@ -155,6 +155,7 @@ extern const char gSubMenu_SCRAMBLER[11][7];
|
|||||||
extern bool gIsInSubMenu;
|
extern bool gIsInSubMenu;
|
||||||
|
|
||||||
extern uint8_t gMenuCursor;
|
extern uint8_t gMenuCursor;
|
||||||
|
int GetCurrentMenuId();
|
||||||
extern int8_t gMenuScrollDirection;
|
extern int8_t gMenuScrollDirection;
|
||||||
extern int32_t gSubMenuSelection;
|
extern int32_t gSubMenuSelection;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user