mirror of
https://github.com/silenty4ng/uv-k5-firmware-chinese-lts
synced 2025-01-28 13:16:01 +00:00
MDC RX
This commit is contained in:
parent
7ee2ef3e73
commit
d54e89d477
3 changed files with 70 additions and 15 deletions
|
@ -22,11 +22,8 @@
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="cea36e80-e289-4d69-9030-7186d540ac0e" name="更改" comment="MDC RX">
|
<list default="true" id="cea36e80-e289-4d69-9030-7186d540ac0e" name="更改" comment="MDC RX">
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/mdc1200.c" beforeDir="false" afterPath="$PROJECT_DIR$/app/mdc1200.c" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/menu.c" beforeDir="false" afterPath="$PROJECT_DIR$/app/menu.c" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/mdc1200.h" beforeDir="false" afterPath="$PROJECT_DIR$/app/mdc1200.h" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/ui/menu.c" beforeDir="false" afterPath="$PROJECT_DIR$/ui/menu.c" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/functions.c" beforeDir="false" afterPath="$PROJECT_DIR$/functions.c" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/radio.c" beforeDir="false" afterPath="$PROJECT_DIR$/radio.c" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/版本说明.txt" beforeDir="false" afterPath="$PROJECT_DIR$/版本说明.txt" afterDir="false" />
|
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
@ -133,7 +130,7 @@
|
||||||
<workItem from="1701413653518" duration="3544000" />
|
<workItem from="1701413653518" duration="3544000" />
|
||||||
<workItem from="1701430185864" duration="10115000" />
|
<workItem from="1701430185864" duration="10115000" />
|
||||||
<workItem from="1701559895523" duration="22519000" />
|
<workItem from="1701559895523" duration="22519000" />
|
||||||
<workItem from="1701678199532" duration="8883000" />
|
<workItem from="1701678199532" duration="10438000" />
|
||||||
</task>
|
</task>
|
||||||
<task id="LOCAL-00001" summary="bug fix">
|
<task id="LOCAL-00001" summary="bug fix">
|
||||||
<created>1701136012311</created>
|
<created>1701136012311</created>
|
||||||
|
@ -380,7 +377,14 @@
|
||||||
<option name="project" value="LOCAL" />
|
<option name="project" value="LOCAL" />
|
||||||
<updated>1701686694191</updated>
|
<updated>1701686694191</updated>
|
||||||
</task>
|
</task>
|
||||||
<option name="localTasksCounter" value="36" />
|
<task id="LOCAL-00036" summary="MDC RX">
|
||||||
|
<created>1701687970236</created>
|
||||||
|
<option name="number" value="00036" />
|
||||||
|
<option name="presentableId" value="LOCAL-00036" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1701687970236</updated>
|
||||||
|
</task>
|
||||||
|
<option name="localTasksCounter" value="37" />
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="TypeScriptGeneratedFilesManager">
|
<component name="TypeScriptGeneratedFilesManager">
|
||||||
|
|
39
app/menu.c
39
app/menu.c
|
@ -1437,8 +1437,45 @@ static void MENU_Key_MENU(const bool bKeyPressed, const bool bKeyHeld)
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#ifdef ENABLE_MDC1200
|
||||||
|
if (UI_MENU_GetCurrentMenuId() == MENU_MDC_ID)
|
||||||
|
{
|
||||||
|
if (edit_index < 0)
|
||||||
|
{
|
||||||
|
edit_index = 0;
|
||||||
|
while (edit_index < 4)
|
||||||
|
edit[edit_index++] = '_';
|
||||||
|
edit_index = 0; // 'edit_index' is going to be used as the cursor position
|
||||||
|
// make a copy so we can test for change when exiting the menu item
|
||||||
|
memmove(edit_original, edit, sizeof(edit_original));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (edit_index >= 0 && edit_index < 4)
|
||||||
|
{ // editing the channel name characters
|
||||||
|
|
||||||
if (UI_MENU_GetCurrentMenuId() == MENU_MEM_NAME)
|
if (++edit_index < 4)
|
||||||
|
return; // next char
|
||||||
|
|
||||||
|
// exit
|
||||||
|
if (memcmp(edit_original, edit, sizeof(edit_original)) == 0)
|
||||||
|
{ // no change - drop it
|
||||||
|
gFlagAcceptSetting = false;
|
||||||
|
gIsInSubMenu = false;
|
||||||
|
gAskForConfirmation = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gFlagAcceptSetting = false;
|
||||||
|
gAskForConfirmation = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
if (UI_MENU_GetCurrentMenuId() == MENU_MEM_NAME)
|
||||||
{
|
{
|
||||||
if (edit_index < 0)
|
if (edit_index < 0)
|
||||||
{ // enter channel name edit mode
|
{ // enter channel name edit mode
|
||||||
|
|
28
ui/menu.c
28
ui/menu.c
|
@ -676,7 +676,27 @@ void UI_DisplayMenu(void) {
|
||||||
already_printed = true;
|
already_printed = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#ifdef ENABLE_MDC1200
|
||||||
|
// case MENU_MDC_ID:
|
||||||
|
// /// char mdc_id_str[4];
|
||||||
|
// sprintf(String, "%04X", gEeprom.MDC1200_ID); // %04X确保输出是4个字符长度的十六进制数
|
||||||
|
// // strcpy(String, id);
|
||||||
|
// break;
|
||||||
|
|
||||||
|
case MENU_MDC_ID:
|
||||||
|
{
|
||||||
|
if (!gIsInSubMenu||edit_index<0) { // show the channel name
|
||||||
|
sprintf(String, "%04X", gEeprom.MDC1200_ID); // %04X确保输出是4个字符长度的十六进制数
|
||||||
|
UI_PrintStringSmall(String, menu_item_x1, menu_item_x2, 3);//4
|
||||||
|
} else { // show the channel name being edited
|
||||||
|
UI_PrintStringSmall(edit, menu_item_x1, 0, 3);
|
||||||
|
if (edit_index < 4)
|
||||||
|
UI_PrintStringSmall("^", menu_item_x1 + (8 * edit_index), 0, 4); // show the cursor
|
||||||
|
}
|
||||||
|
already_printed = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
case MENU_MEM_NAME: {
|
case MENU_MEM_NAME: {
|
||||||
const bool valid = RADIO_CheckValidChannel(gSubMenuSelection, false, 1);
|
const bool valid = RADIO_CheckValidChannel(gSubMenuSelection, false, 1);
|
||||||
|
|
||||||
|
@ -804,13 +824,7 @@ void UI_DisplayMenu(void) {
|
||||||
strcpy(String, gEeprom.ANI_DTMF_ID);
|
strcpy(String, gEeprom.ANI_DTMF_ID);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_MDC1200
|
|
||||||
case MENU_MDC_ID:
|
|
||||||
/// char mdc_id_str[4];
|
|
||||||
sprintf(String, "%04X", gEeprom.MDC1200_ID); // %04X确保输出是4个字符长度的十六进制数
|
|
||||||
// strcpy(String, id);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
case MENU_UPCODE:
|
case MENU_UPCODE:
|
||||||
strcpy(String, gEeprom.DTMF_UP_CODE);
|
strcpy(String, gEeprom.DTMF_UP_CODE);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue