mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-28 14:21:25 +03:00
Updated/Fix menu channel edit name
This commit is contained in:
parent
a3aa3da2db
commit
e3c4f1d28c
63
app/menu.c
63
app/menu.c
@ -1097,7 +1097,7 @@ void MENU_ShowCurrentSetting(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MENU_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||||
{
|
{
|
||||||
uint8_t Offset;
|
uint8_t Offset;
|
||||||
int32_t Min;
|
int32_t Min;
|
||||||
@ -1109,6 +1109,28 @@ static void MENU_Key_DIGITS(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)
|
||||||
|
{ // currently editing the channel name
|
||||||
|
|
||||||
|
if (edit_index < 10)
|
||||||
|
{
|
||||||
|
if (Key >= KEY_0 && Key <= KEY_9)
|
||||||
|
{
|
||||||
|
edit[edit_index] = '0' + Key - KEY_0;
|
||||||
|
|
||||||
|
if (++edit_index >= 10)
|
||||||
|
{ // exit edit
|
||||||
|
gFlagAcceptSetting = false;
|
||||||
|
gAskForConfirmation = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
gRequestDisplayScreen = DISPLAY_MENU;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
INPUTBOX_Append(Key);
|
INPUTBOX_Append(Key);
|
||||||
|
|
||||||
gRequestDisplayScreen = DISPLAY_MENU;
|
gRequestDisplayScreen = DISPLAY_MENU;
|
||||||
@ -1339,7 +1361,7 @@ static void MENU_Key_MENU(const bool bKeyPressed, const bool bKeyHeld)
|
|||||||
|
|
||||||
// exit
|
// exit
|
||||||
if (memcmp(edit_original, edit, sizeof(edit_original)) == 0)
|
if (memcmp(edit_original, edit, sizeof(edit_original)) == 0)
|
||||||
{ // no change
|
{ // no change - drop it
|
||||||
gFlagAcceptSetting = false;
|
gFlagAcceptSetting = false;
|
||||||
gIsInSubMenu = false;
|
gIsInSubMenu = false;
|
||||||
gAskForConfirmation = 0;
|
gAskForConfirmation = 0;
|
||||||
@ -1423,6 +1445,25 @@ 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)
|
||||||
|
{ // currently editing the channel name
|
||||||
|
|
||||||
|
if (edit_index < 10)
|
||||||
|
{
|
||||||
|
edit[edit_index] = '-';
|
||||||
|
|
||||||
|
if (++edit_index >= 10)
|
||||||
|
{ // exit edit
|
||||||
|
gFlagAcceptSetting = false;
|
||||||
|
gAskForConfirmation = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
gRequestDisplayScreen = DISPLAY_MENU;
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
RADIO_SelectVfos();
|
RADIO_SelectVfos();
|
||||||
|
|
||||||
#ifdef ENABLE_NOAA
|
#ifdef ENABLE_NOAA
|
||||||
@ -1618,7 +1659,7 @@ void MENU_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
|||||||
case KEY_7:
|
case KEY_7:
|
||||||
case KEY_8:
|
case KEY_8:
|
||||||
case KEY_9:
|
case KEY_9:
|
||||||
MENU_Key_DIGITS(Key, bKeyPressed, bKeyHeld);
|
MENU_Key_0_to_9(Key, bKeyPressed, bKeyHeld);
|
||||||
break;
|
break;
|
||||||
case KEY_MENU:
|
case KEY_MENU:
|
||||||
MENU_Key_MENU(bKeyPressed, bKeyHeld);
|
MENU_Key_MENU(bKeyPressed, bKeyHeld);
|
||||||
@ -1636,6 +1677,22 @@ 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)
|
||||||
|
{ // currently editing the channel name
|
||||||
|
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
||||||
|
if (edit_index < 10)
|
||||||
|
{
|
||||||
|
edit[edit_index] = ' ';
|
||||||
|
if (++edit_index >= 10)
|
||||||
|
{ // exit edit
|
||||||
|
gFlagAcceptSetting = false;
|
||||||
|
gAskForConfirmation = 1;
|
||||||
|
}
|
||||||
|
gRequestDisplayScreen = DISPLAY_MENU;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
GENERIC_Key_F(bKeyPressed, bKeyHeld);
|
GENERIC_Key_F(bKeyPressed, bKeyHeld);
|
||||||
break;
|
break;
|
||||||
case KEY_PTT:
|
case KEY_PTT:
|
||||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user