From 0452bd0f10b2c677683ff431474859d5472beb7e Mon Sep 17 00:00:00 2001 From: vk7js <58905135+vk7js@users.noreply.github.com> Date: Mon, 5 Sep 2022 23:03:41 +1000 Subject: [PATCH] Added voice feedback for setting the time and date. --- openrtx/src/core/voicePromptUtils.c | 3 +++ openrtx/src/ui/ui.c | 24 +++++++++++++++--------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/openrtx/src/core/voicePromptUtils.c b/openrtx/src/core/voicePromptUtils.c index 20913ef4..ca12f53c 100644 --- a/openrtx/src/core/voicePromptUtils.c +++ b/openrtx/src/core/voicePromptUtils.c @@ -663,6 +663,9 @@ void vp_announceSettingsTimeDate() local_time.year); vp_queueString(buffer, vpAnnounceCommonSymbols | vpAnnounceLessCommonSymbols); + + vp_queuePrompt(PROMPT_SILENCE); + vp_queuePrompt(PROMPT_SILENCE); snprintf(buffer, 16, "%02d:%02d:%02d", local_time.hour, local_time.minute, local_time.second); diff --git a/openrtx/src/ui/ui.c b/openrtx/src/ui/ui.c index 38aea61e..d1b35709 100644 --- a/openrtx/src/ui/ui.c +++ b/openrtx/src/ui/ui.c @@ -481,6 +481,17 @@ static freq_t _ui_freq_add_digit(freq_t freq, uint8_t pos, uint8_t number) static void _ui_timedate_add_digit(datetime_t *timedate, uint8_t pos, uint8_t number) { + vp_flush(); + if (pos==3 || pos==5) + vp_queuePrompt(PROMPT_SLASH); + // just indicates separation of date and time. + if (pos==7) // start of time. + vp_queuePrompt(PROMPT_SPACE); + if (pos==9 || pos==11) + vp_queuePrompt(PROMPT_COLON); + vp_queueInteger(number); + vp_play(); + switch(pos) { // Set date @@ -1684,21 +1695,15 @@ void ui_updateFSM(bool *sync_rtx) #ifdef RTC_PRESENT // Time&Date settings screen case SETTINGS_TIMEDATE: - if ((msg.keys & KEY_F1) && (state.settings.vpLevel > vpBeep)) - {// quick press repeat vp, long press summary. - if (msg.long_press) - vp_announceSettingsTimeDate(); - else - vp_replayLastPrompt(); - f1Handled = true; - } - else if(msg.keys & KEY_ENTER) + if(msg.keys & KEY_ENTER) { // Switch to set Time&Date mode state.ui_screen = SETTINGS_TIMEDATE_SET; // Reset input position and selection ui_state.input_position = 0; memset(&ui_state.new_timedate, 0, sizeof(datetime_t)); + vp_announceBuffer(¤tLanguage->timeAndDate, + true, false, ""); } else if(msg.keys & KEY_ESC) _ui_menuBack(MENU_SETTINGS); @@ -1716,6 +1721,7 @@ void ui_updateFSM(bool *sync_rtx) state.settings.utc_timezone); rtc_setTime(utc_time); state.time = utc_time; + vp_announceSettingsTimeDate(); state.ui_screen = SETTINGS_TIMEDATE; } else if(msg.keys & KEY_ESC)