Updated voice prompt for UTC timezone to support also half hour values, thanks to Joe VK7JS.

md1702 v0.3.5
Silvano Seva 2022-10-31 18:04:08 +01:00
rodzic ce1dc202ae
commit ae8bba88b6
3 zmienionych plików z 45 dodań i 3 usunięć

Wyświetl plik

@ -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

Wyświetl plik

@ -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(&currentLanguage->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);
}

Wyświetl plik

@ -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(&currentLanguage->UTCTimeZone,
queueFlags,
state.settings.utc_timezone);
vp_announceTimeZone(state.settings.utc_timezone, queueFlags);
break;
default:
state.ui_screen = SETTINGS_GPS;