mirror of
https://github.com/silenty4ng/uv-k5-firmware-chinese-lts
synced 2025-01-15 14:54:40 +00:00
MDC RX
This commit is contained in:
parent
e2f93c2ca9
commit
988ee09c84
1 changed files with 29 additions and 22 deletions
51
app/menu.c
51
app/menu.c
|
@ -1642,29 +1642,36 @@ static void MENU_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
|
||||||
uint8_t VFO;
|
uint8_t VFO;
|
||||||
uint8_t Channel;
|
uint8_t Channel;
|
||||||
bool bCheckScanList;
|
bool bCheckScanList;
|
||||||
|
if(&& gIsInSubMenu && edit_index >= 0){
|
||||||
|
if (UI_MENU_GetCurrentMenuId() == MENU_MEM_NAME) { // change the character
|
||||||
|
if (bKeyPressed && edit_index < 10 && Direction != 0) {
|
||||||
|
const char unwanted[] = "$%&!\"':;?^`|{}";
|
||||||
|
char c = edit[edit_index] + Direction;
|
||||||
|
unsigned int i = 0;
|
||||||
|
while (i < sizeof(unwanted) && c >= 32 && c <= 126) {
|
||||||
|
if (c == unwanted[i++]) { // choose next character
|
||||||
|
c += Direction;
|
||||||
|
i = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
edit[edit_index] = (c < 32) ? 126 : (c > 126) ? 32 : c;
|
||||||
|
|
||||||
if (UI_MENU_GetCurrentMenuId() == MENU_MEM_NAME && gIsInSubMenu && edit_index >= 0)
|
gRequestDisplayScreen = DISPLAY_MENU;
|
||||||
{ // change the character
|
}
|
||||||
if (bKeyPressed && edit_index < 10 && Direction != 0)
|
return;
|
||||||
{
|
} else if (UI_MENU_GetCurrentMenuId() == MENU_MDC_ID)
|
||||||
const char unwanted[] = "$%&!\"':;?^`|{}";
|
{
|
||||||
char c = edit[edit_index] + Direction;
|
if (bKeyPressed && edit_index < 4 && Direction != 0) {
|
||||||
unsigned int i = 0;
|
char c = edit[edit_index] + Direction;
|
||||||
while (i < sizeof(unwanted) && c >= 32 && c <= 126)
|
if(c<'0')c='F';
|
||||||
{
|
else if(c>'9')c='A';
|
||||||
if (c == unwanted[i++])
|
else if(c<'A')c='9';
|
||||||
{ // choose next character
|
else if(c>'F')c='0';
|
||||||
c += Direction;
|
gRequestDisplayScreen = DISPLAY_MENU;
|
||||||
i = 0;
|
}
|
||||||
}
|
return;
|
||||||
}
|
}
|
||||||
edit[edit_index] = (c < 32) ? 126 : (c > 126) ? 32 : c;
|
}
|
||||||
|
|
||||||
gRequestDisplayScreen = DISPLAY_MENU;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!bKeyHeld)
|
if (!bKeyHeld)
|
||||||
{
|
{
|
||||||
if (!bKeyPressed)
|
if (!bKeyPressed)
|
||||||
|
|
Loading…
Reference in a new issue