Added announceSettingsTimeDate and hooked up to f1 on that screen.

This commit is contained in:
vk7js 2022-05-20 21:55:31 +10:00 committed by Silvano Seva
parent 29bde26f4f
commit 7cd3f1d49a
3 changed files with 34 additions and 2 deletions

View File

@ -71,7 +71,9 @@ void announceGPSInfo();
void announceAboutScreen();
void announceBackupScreen();
void announceRestoreScreen();
#ifdef RTC_PRESENT
void announceSettingsTimeDate();
#endif // RTC_PRESENT
VoicePromptQueueFlags_T GetQueueFlagsForVoiceLevel();
#endif //VOICE_PROMPT_UTILS_H_INCLUDED

View File

@ -588,6 +588,28 @@ void announceRestoreScreen()
vpPlay();
}
#ifdef RTC_PRESENT
void announceSettingsTimeDate()
{
vpInit();
vpQueueStringTableEntry(&currentLanguage->timeAndDate);
datetime_t local_time = utcToLocalTime(state.time, state.settings.utc_timezone);
char buffer[16] = "\0";
snprintf(buffer, 16, "%02d/%02d/%02d",
local_time.date, local_time.month, local_time.year);
vpQueueString(buffer, (vpAnnounceCommonSymbols | vpAnnounceLessCommonSymbols));
snprintf(buffer, 16, "%02d:%02d:%02d",
local_time.hour, local_time.minute, local_time.second);
vpQueueString(buffer, (vpAnnounceCommonSymbols | vpAnnounceLessCommonSymbols));
vpPlay();
}
#endif // RTC_PRESENT
/*
there are 5 levels of verbosity:

View File

@ -1540,7 +1540,15 @@ void ui_updateFSM(bool *sync_rtx)
#ifdef RTC_PRESENT
// Time&Date settings screen
case SETTINGS_TIMEDATE:
if(msg.keys & KEY_ENTER)
if ((msg.keys & KEY_F1) && (state.settings.vpLevel > vpBeep))
{// quick press repeat vp, long press summary.
if (msg.long_press)
announceSettingsTimeDate();
else
ReplayLastPrompt();
f1Handled = true;
}
else if(msg.keys & KEY_ENTER)
{
// Switch to set Time&Date mode
state.ui_screen = SETTINGS_TIMEDATE_SET;