From f61c26927021fbec0c356c8593dde4d9c8c91497 Mon Sep 17 00:00:00 2001 From: Federico Amedeo Izzo Date: Tue, 26 Jan 2021 21:19:11 +0100 Subject: [PATCH] UI: Replace GPS with MODE selection on macro menu --- openrtx/src/ui/ui.c | 7 +++++++ openrtx/src/ui/ui_menu.c | 12 +++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/openrtx/src/ui/ui.c b/openrtx/src/ui/ui.c index 00825cec..138f24a2 100644 --- a/openrtx/src/ui/ui.c +++ b/openrtx/src/ui/ui.c @@ -514,6 +514,13 @@ void _ui_fsm_menuMacro(kbd_msg_t msg, bool *sync_rtx) { state.channel.bandwidth %= 3; *sync_rtx = true; break; + case 5: + if(state.channel.mode == FM) + state.channel.mode = DMR; + else if(state.channel.mode == DMR) + state.channel.mode = FM; + *sync_rtx = true; + break; case 7: new_blight += 25; new_blight = (new_blight > 255) ? 255 : new_blight; diff --git a/openrtx/src/ui/ui_menu.c b/openrtx/src/ui/ui_menu.c index d8c9b8cc..5d24f43b 100644 --- a/openrtx/src/ui/ui_menu.c +++ b/openrtx/src/ui/ui_menu.c @@ -275,7 +275,17 @@ bool _ui_drawMenuMacro(state_t* last_state) { color_white); gfx_print(layout.line2_left, "5 ", layout.top_font, TEXT_ALIGN_CENTER, yellow_fab413); - gfx_print(layout.line2_left, " GPS", layout.top_font, TEXT_ALIGN_CENTER, + char mode_str[9] = ""; + switch(last_state->channel.mode) + { + case FM: + snprintf(mode_str, 9," FM"); + break; + case DMR: + snprintf(mode_str, 9," DMR"); + break; + } + gfx_print(layout.line2_left, mode_str, layout.top_font, TEXT_ALIGN_CENTER, color_white); gfx_print(layout.line2_right, "6 ", layout.top_font, TEXT_ALIGN_RIGHT, yellow_fab413);