From d8fa0465fb33eb7239a3dc9cbe6d65f04e4a4538 Mon Sep 17 00:00:00 2001 From: vk7js <58905135+vk7js@users.noreply.github.com> Date: Sat, 10 Sep 2022 10:11:01 +1000 Subject: [PATCH] Fixed following bug: 1. hit enter to go to banks menu. 2. hit escape. 3. hit enter again and radio does not announce banks menu because it was the last menu active. Now reset the menu tracking variables on Escape. --- openrtx/src/ui/ui.c | 4 ++++ openrtx/src/ui/ui_menu.c | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/openrtx/src/ui/ui.c b/openrtx/src/ui/ui.c index fda9cbb9..26410624 100644 --- a/openrtx/src/ui/ui.c +++ b/openrtx/src/ui/ui.c @@ -117,6 +117,7 @@ extern void _ui_drawSettingsM17(ui_state_t* ui_state); extern void _ui_drawSettingsVoicePrompts(ui_state_t* ui_state); extern void _ui_drawSettingsReset2Defaults(ui_state_t* ui_state); extern bool _ui_drawMacroMenu(); +extern void _ui_reset_menu_anouncement_tracking(); const char *menu_items[] = { @@ -1971,6 +1972,9 @@ void ui_updateFSM(bool *sync_rtx) // to beep or you'll get an unwanted click. if ((msg.keys &0xffff) && (state.settings.vpLevel == vpBeep)) vp_beep(750, 3); + // If we exit and re-enter the same menu, we want to ensure it speaks. + if (msg.keys & KEY_ESC) + _ui_reset_menu_anouncement_tracking(); } else if(event.type == EVENT_STATUS) { diff --git a/openrtx/src/ui/ui_menu.c b/openrtx/src/ui/ui_menu.c index 3ae7d438..55643193 100644 --- a/openrtx/src/ui/ui_menu.c +++ b/openrtx/src/ui/ui_menu.c @@ -58,6 +58,11 @@ const char *display_timer_values[] = "45 min", "1 hour" }; +void _ui_reset_menu_anouncement_tracking() + { + *priorSelectedMenuName='\0'; + *priorSelectedMenuValue='\0'; + } static bool DidSelectedMenuItemChange(char* menuName, char* menuValue) { @@ -113,7 +118,7 @@ static bool ScreenContainsReadOnlyEntries(int menuScreen) } return false; } - + static void announceMenuItemIfNeeded(char* name, char* value, bool editMode) { if (state.settings.vpLevel < vpLow)