From cccc0935786646d01287e91821379e3adf9a97ee Mon Sep 17 00:00:00 2001 From: wu58430 Date: Sun, 10 Dec 2023 13:15:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0MDC=E8=81=94=E7=B3=BB?= =?UTF-8?q?=E4=BA=BA=E7=BC=96=E8=AF=91=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 2 ++ README.md | 1 + app/mdc1200.c | 3 ++- ui/main.c | 63 ++++++++++++++++++++++++++++----------------------- 4 files changed, 40 insertions(+), 29 deletions(-) diff --git a/Makefile b/Makefile index 3c4e694..533f309 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,8 @@ ENABLE_SCAN_RANGES := 1 ENABLE_MDC1200 := 1 ENABLE_MDC1200_SHOW_OP_ARG := 1 ENABLE_MDC1200_SIDE_BEEP := 0 +ENABLE_MDC1200_CONRACT := 1 + # ---- DEBUGGING ---- ENABLE_AM_FIX_SHOW_DATA := 0 diff --git a/README.md b/README.md index d678fa4..6ce1bf7 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,7 @@ ENABLE_SCAN_RANGES := 1 扫描范围 ENABLE_MDC1200 := 1 MDC1200发送功能 ENABLE_MDC1200_SHOW_OP_ARG := 1 MDC显示首尾音参数 ENABLE_MDC1200_SIDE_BEEP := 0 MDC侧音 +ENABLE_MDC1200_CONRACT := 1 MDC联系人,开启后ENABLE_MDC1200_SHOW_OP_ARG失效 ENABLE_AM_FIX_SHOW_DATA := 0 显示 AM 修复的调试数据(仍在调整) ENABLE_AGC_SHOW_DATA := 0 显示ACG参数 ``` diff --git a/app/mdc1200.c b/app/mdc1200.c index 596744d..ef90a1a 100644 --- a/app/mdc1200.c +++ b/app/mdc1200.c @@ -533,6 +533,7 @@ uint16_t extractHex(const char *str) { } return result; } +#ifdef ENABLE_MDC1200_CONRACT uint8_t contact_num=0; uint16_t MDC_ADD[4] = {0x1D48, 0x1D88, 0x1DC8,0x1F08}; void mdc1200_update_contact_num() @@ -583,4 +584,4 @@ bool mdc1200_contact_find(uint16_t mdc_id, char *contact) { // UART_Send(A,64); // EEPROM_ReadBuffer(MDC_ADD4, A, sizeof(A)); // UART_Send(A,64); - +#endif diff --git a/ui/main.c b/ui/main.c index 4bc8cb4..a2e1cdd 100644 --- a/ui/main.c +++ b/ui/main.c @@ -734,9 +734,11 @@ void UI_DisplayMain(void) { #ifdef ENABLE_MDC1200 if (mdc1200_rx_ready_tick_500ms > 0) { - char mdc1200_contact[14]; center_line = CENTER_LINE_MDC1200; +#ifdef ENABLE_MDC1200_CONTACT uint8_t print_col = 0; + char mdc1200_contact[14]; + if (mdc1200_contact_find(mdc1200_unit_id, mdc1200_contact))// { @@ -747,48 +749,53 @@ void UI_DisplayMain(void) { sprintf(String, "ID %04X", mdc1200_unit_id); print_col = 40; } + UI_PrintStringSmallBold(String, print_col, 0, 3); -//#ifdef ENABLE_MDC1200_SHOW_OP_ARG -// sprintf(String, "MDC1200 %02X %02X %04X", mdc1200_op, mdc1200_arg, mdc1200_unit_id); -//#else -// sprintf(String, "MDC1200 ID %04X", mdc1200_unit_id); -//#endif +#elifdef ENABLE_MDC1200_SHOW_OP_ARG + sprintf(String, "MDC1200 %02X %02X %04X", mdc1200_op, mdc1200_arg, mdc1200_unit_id); + UI_PrintStringSmallBold(String, 4, 0, 3); + +#else + sprintf(String, "MDC1200 ID %04X", mdc1200_unit_id); + UI_PrintStringSmallBold(String, 4, 0, 3); + + +#endif - UI_PrintStringSmallBold(String, print_col, 0, 3); } else #endif #ifdef ENABLE_AUDIO_BAR - if (gCurrentFunction == FUNCTION_TRANSMIT) { - center_line = CENTER_LINE_AUDIO_BAR; - UI_DisplayAudioBar(); - } - else + if (gCurrentFunction == FUNCTION_TRANSMIT) { + center_line = CENTER_LINE_AUDIO_BAR; + UI_DisplayAudioBar(); + } + else #endif #if defined(ENABLE_AM_FIX) && defined(ENABLE_AM_FIX_SHOW_DATA) - if (rx && gEeprom.VfoInfo[gEeprom.RX_VFO].Modulation == MODULATION_AM && gSetting_AM_fix) - { - if (gScreenToDisplay != DISPLAY_MAIN + if (rx && gEeprom.VfoInfo[gEeprom.RX_VFO].Modulation == MODULATION_AM && gSetting_AM_fix) + { + if (gScreenToDisplay != DISPLAY_MAIN #ifdef ENABLE_DTMF_CALLING - || gDTMF_CallState != DTMF_CALL_STATE_NONE + || gDTMF_CallState != DTMF_CALL_STATE_NONE #endif - ) - return; + ) + return; - center_line = CENTER_LINE_AM_FIX_DATA; - AM_fix_print_data(gEeprom.RX_VFO, String); - UI_PrintStringSmall(String, 2, 0, 3); - } - else + center_line = CENTER_LINE_AM_FIX_DATA; + AM_fix_print_data(gEeprom.RX_VFO, String); + UI_PrintStringSmall(String, 2, 0, 3); + } + else #endif #ifdef ENABLE_RSSI_BAR - if (rx) { - center_line = CENTER_LINE_RSSI; - DisplayRSSIBar(false); - } - else + if (rx) { + center_line = CENTER_LINE_RSSI; + DisplayRSSIBar(false); + } + else #endif if (rx || gCurrentFunction == FUNCTION_FOREGROUND || gCurrentFunction == FUNCTION_POWER_SAVE) {