diff --git a/openrtx/include/core/voicePromptUtils.h b/openrtx/include/core/voicePromptUtils.h index 222cb9fe..4862c9fa 100644 --- a/openrtx/include/core/voicePromptUtils.h +++ b/openrtx/include/core/voicePromptUtils.h @@ -223,9 +223,18 @@ vpQueueFlags_t vp_getVoiceLevelQueueFlags(); * */ void vp_playMenuBeepIfNeeded(bool firstItem); + /** * */ void vp_announceSplashScreen(); +/** + * Announce timezone value. + * + * @param timeZone: timezone value. + * @param flags: control flags. + */ +void vp_announceTimeZone(const int8_t timeZone, const vpQueueFlags_t flags); + #endif // VOICE_PROMPT_UTILS_H diff --git a/openrtx/src/core/voicePromptUtils.c b/openrtx/src/core/voicePromptUtils.c index 62c75512..af879e26 100644 --- a/openrtx/src/core/voicePromptUtils.c +++ b/openrtx/src/core/voicePromptUtils.c @@ -1066,3 +1066,38 @@ void vp_announceSplashScreen() vp_announceRadioMode(state.channel.mode, localFlags); vp_play(); } + +void vp_announceTimeZone(const int8_t timeZone, const vpQueueFlags_t flags) +{ + clearCurrPromptIfNeeded(flags); + + if (flags & vpqIncludeDescriptions) + { + vp_queueStringTableEntry(¤tLanguage->UTCTimeZone); + } + + int wholeHours = timeZone / 2; + int halfHour = timeZone % 2; + + // While vp_queueInteeger handles negative numbers, we want to explicitly + // say the sign even when positive. + if (timeZone > 0) + { + vp_queuePrompt(PROMPT_PLUS); + } + else if (timeZone < 0) + { + vp_queuePrompt(PROMPT_MINUS); + wholeHours *= -1; + } + + vp_queueInteger(wholeHours); + + if (halfHour != 0) + { + vp_queuePrompt(PROMPT_POINT); + vp_queueInteger(5); + } + + playIfNeeded(flags); +} diff --git a/openrtx/src/ui/ui.c b/openrtx/src/ui/ui.c index 38cc0ef6..babae39b 100644 --- a/openrtx/src/ui/ui.c +++ b/openrtx/src/ui/ui.c @@ -1899,9 +1899,7 @@ void ui_updateFSM(bool *sync_rtx) else if(msg.keys & KEY_RIGHT || msg.keys & KEY_UP || msg.keys & KNOB_RIGHT) state.settings.utc_timezone += 1; - vp_announceSettingsInt(¤tLanguage->UTCTimeZone, - queueFlags, - state.settings.utc_timezone); + vp_announceTimeZone(state.settings.utc_timezone, queueFlags); break; default: state.ui_screen = SETTINGS_GPS;