This commit is contained in:
wu58430 2023-12-04 21:06:48 +08:00
parent 949c4fb70c
commit 8e85f2bccc
2 changed files with 5 additions and 4 deletions

View file

@ -1452,9 +1452,11 @@ static void MENU_Key_MENU(const bool bKeyPressed, const bool bKeyHeld)
{ {
if (edit_index < 0) if (edit_index < 0)
{ {
edit_index = 0; // edit_index = 0;
while (edit_index < 4) sprintf(edit, "%04X", gEeprom.MDC1200_ID); // %04X确保输出是4个字符长度的十六进制数
edit[edit_index++] = '_';
// while (edit_index < 4)
// edit[edit_index++] = '_';
edit_index = 0; // 'edit_index' is going to be used as the cursor position 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 // make a copy so we can test for change when exiting the menu item
memmove(edit_original, edit, sizeof(edit_original)); memmove(edit_original, edit, sizeof(edit_original));

View file

@ -687,7 +687,6 @@ void UI_DisplayMenu(void) {
{ {
// gIsInSubMenu // gIsInSubMenu
if (!gIsInSubMenu||edit_index<0) { // show the channel name if (!gIsInSubMenu||edit_index<0) { // show the channel name
sprintf(edit, "%04X", gEeprom.MDC1200_ID); // %04X确保输出是4个字符长度的十六进制数
sprintf(String, "%04X", gEeprom.MDC1200_ID); // %04X确保输出是4个字符长度的十六进制数 sprintf(String, "%04X", gEeprom.MDC1200_ID); // %04X确保输出是4个字符长度的十六进制数
UI_PrintStringSmall(String, menu_item_x1, menu_item_x2, 3);//4 UI_PrintStringSmall(String, menu_item_x1, menu_item_x2, 3);//4