From c04ceb9a8d3c97c2dbe94eea087b71eb29dbe99f Mon Sep 17 00:00:00 2001 From: Federico Amedeo Izzo Date: Mon, 23 Aug 2021 22:05:13 +0200 Subject: [PATCH] Add M17 radio mode to UI --- openrtx/src/ui/ui.c | 3 +++ openrtx/src/ui/ui_main.c | 11 +++++++++++ openrtx/src/ui/ui_menu.c | 3 +++ 3 files changed, 17 insertions(+) diff --git a/openrtx/src/ui/ui.c b/openrtx/src/ui/ui.c index 1512bb24..27645c3b 100644 --- a/openrtx/src/ui/ui.c +++ b/openrtx/src/ui/ui.c @@ -676,9 +676,12 @@ void _ui_fsm_menuMacro(kbd_msg_t msg, bool *sync_rtx) { *sync_rtx = true; break; case 5: + // Cycle through radio modes if(state.channel.mode == FM) state.channel.mode = DMR; else if(state.channel.mode == DMR) + state.channel.mode = M17; + else if(state.channel.mode == M17) state.channel.mode = FM; *sync_rtx = true; break; diff --git a/openrtx/src/ui/ui_main.c b/openrtx/src/ui/ui_main.c index 6ed84de3..3fc1a816 100644 --- a/openrtx/src/ui/ui_main.c +++ b/openrtx/src/ui/ui_main.c @@ -63,6 +63,10 @@ void _ui_drawMainTop() gfx_print(layout.top_pos, layout.top_font, TEXT_ALIGN_LEFT, color_white, "DMR"); break; + case M17: + gfx_print(layout.top_pos, layout.top_font, TEXT_ALIGN_LEFT, + color_white, "M17"); + break; } } @@ -171,6 +175,13 @@ void _ui_drawMainBottom() rssi, 255); break; + case M17: + gfx_drawSmeterLevel(meter_pos, + meter_width, + meter_height, + rssi, + 255); + break; } } diff --git a/openrtx/src/ui/ui_menu.c b/openrtx/src/ui/ui_menu.c index 402184fb..3183e829 100644 --- a/openrtx/src/ui/ui_menu.c +++ b/openrtx/src/ui/ui_menu.c @@ -604,6 +604,9 @@ bool _ui_drawMacroMenu() { case DMR: snprintf(mode_str, 9," DMR"); break; + case M17: + snprintf(mode_str, 9," M17"); + break; } gfx_print(pos_2, layout.top_font, TEXT_ALIGN_CENTER, color_white, mode_str);