From 7e291fe6fd79dfeb2c653e40834ccb71e8f4ea5e Mon Sep 17 00:00:00 2001 From: tarxvf Date: Wed, 23 Aug 2023 19:03:02 -0400 Subject: [PATCH] Implement UI input lockout logic, toggled by macro menu key 9. Contribution by tarxvf. --- openrtx/include/ui/ui_default.h | 1 + openrtx/src/ui/default/ui.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/openrtx/include/ui/ui_default.h b/openrtx/include/ui/ui_default.h index edf57da5..f85b5824 100644 --- a/openrtx/include/ui/ui_default.h +++ b/openrtx/include/ui/ui_default.h @@ -197,6 +197,7 @@ typedef struct ui_state_t uint8_t menu_selected; // If true we can change a menu entry value with UP/DOWN bool edit_mode; + bool input_locked; // Variables used for VFO input uint8_t input_number; uint8_t input_position; diff --git a/openrtx/src/ui/default/ui.c b/openrtx/src/ui/default/ui.c index 5861f2d1..dd75b3dc 100644 --- a/openrtx/src/ui/default/ui.c +++ b/openrtx/src/ui/default/ui.c @@ -989,6 +989,12 @@ static void _ui_fsm_menuMacro(kbd_msg_t msg, bool *sync_rtx) state.settings.brightness); break; #endif + case 9: + if (!ui_state.input_locked) + ui_state.input_locked = true; + else + ui_state.input_locked = false; + break; } #if defined(PLATFORM_TTWRPLUS) @@ -1337,6 +1343,8 @@ void ui_updateFSM(bool *sync_rtx) *sync_rtx = true; } // M17 Destination callsign input + if (ui_state.input_locked) + break; if(ui_state.edit_mode) { if(state.channel.mode == OPMODE_M17) @@ -1520,6 +1528,8 @@ void ui_updateFSM(bool *sync_rtx) state.txDisable = false; *sync_rtx = true; } + if (ui_state.input_locked) + break; // M17 Destination callsign input if(ui_state.edit_mode) {