From 939a51e166c7f3a73aa5dc75c81013f57ef5c3c4 Mon Sep 17 00:00:00 2001 From: wu58430 Date: Mon, 4 Dec 2023 15:32:57 +0800 Subject: [PATCH] MDC RX --- .idea/workspace.xml | 23 +++++++++++++++-------- app/app.c | 12 +++++++++++- ui/main.c | 19 ++++++++++++++++++- ui/main.h | 3 ++- 4 files changed, 46 insertions(+), 11 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index c8419f7..c1d5aaf 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -20,10 +20,10 @@ - - - - + + + + @@ -323,7 +330,6 @@ - @@ -332,6 +338,7 @@ - \ No newline at end of file diff --git a/app/app.c b/app/app.c index 26eca4a..821d172 100644 --- a/app/app.c +++ b/app/app.c @@ -1399,7 +1399,17 @@ void APP_TimeSlice500ms(void) if (--gDTMF_RX_timeout == 0) DTMF_clear_RX(); #endif - +#ifdef ENABLE_MDC1200 + if (mdc1200_rx_ready_tick_500ms > 0) + { + if (--mdc1200_rx_ready_tick_500ms == 0) + { + if (center_line == CENTER_LINE_MDC1200) + center_line = CENTER_LINE_NONE; + gUpdateDisplay = true; + } + } +#endif // Skipped authentic device check #ifdef ENABLE_FMRADIO diff --git a/ui/main.c b/ui/main.c index c453d6e..67c730d 100644 --- a/ui/main.c +++ b/ui/main.c @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include "app/mdc1200.h" #include "chinese.h" #include #include // abs() @@ -708,7 +709,23 @@ void UI_DisplayMain(void) const bool rx = (gCurrentFunction == FUNCTION_RECEIVE || gCurrentFunction == FUNCTION_MONITOR || gCurrentFunction == FUNCTION_INCOMING); - +#ifdef ENABLE_MDC1200 + if (mdc1200_rx_ready_tick_500ms > 0) + { + center_line = CENTER_LINE_MDC1200; + #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 + #ifdef ENABLE_SMALL_BOLD + UI_PrintStringSmallBold(String, 2, 0, 3); + #else + UI_PrintStringSmall(String, 2, 0, 3); + #endif + } + else +#endif #ifdef ENABLE_AUDIO_BAR if (gCurrentFunction == FUNCTION_TRANSMIT) { center_line = CENTER_LINE_AUDIO_BAR; diff --git a/ui/main.h b/ui/main.h index ba01acc..69c1eab 100644 --- a/ui/main.h +++ b/ui/main.h @@ -24,7 +24,8 @@ enum center_line_t { CENTER_LINE_RSSI, CENTER_LINE_AM_FIX_DATA, CENTER_LINE_DTMF_DEC, - CENTER_LINE_CHARGE_DATA + CENTER_LINE_CHARGE_DATA, + CENTER_LINE_MDC1200 }; typedef enum center_line_t center_line_t;