From fbc4e380b3a29113136298ccb624ac867edd1cad Mon Sep 17 00:00:00 2001 From: vk7js <58905135+vk7js@users.noreply.github.com> Date: Tue, 13 Sep 2022 18:09:32 +1000 Subject: [PATCH] Moved latitude and longitude to after direction in announcement because these are less meaningful than the other parameters. --- openrtx/src/core/voicePromptUtils.c | 48 ++++++++++++++--------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/openrtx/src/core/voicePromptUtils.c b/openrtx/src/core/voicePromptUtils.c index ee14d8b2..df783e81 100644 --- a/openrtx/src/core/voicePromptUtils.c +++ b/openrtx/src/core/voicePromptUtils.c @@ -597,30 +597,6 @@ void vp_announceGPSInfo(vpGPSInfoFlags_t gpsInfoFlags) char buffer[16] = "\0"; - if (gpsInfoFlags & vpGPSLatitude) - { - // lat/long - snprintf(buffer, 16, "%8.6f", state.gps_data.latitude); - removeUnnecessaryZerosFromVoicePrompts(buffer); - vp_queuePrompt(PROMPT_LATITUDE); - vp_queueString(buffer, vpAnnounceCommonSymbols); - vp_queuePrompt(PROMPT_NORTH); - } - - if (gpsInfoFlags & vpGPSLongitude) - { - float longitude = state.gps_data.longitude; - voicePrompt_t direction = (longitude < 0) ? PROMPT_WEST : PROMPT_EAST; - longitude = (longitude < 0) ? -longitude : longitude; - snprintf(buffer, 16, "%8.6f", longitude); - removeUnnecessaryZerosFromVoicePrompts(buffer); - - vp_queuePrompt(PROMPT_LONGITUDE); - vp_queueString(buffer, vpAnnounceCommonSymbols); - vp_queuePrompt(direction); - addSilenceIfNeeded(flags); - } - if (gpsInfoFlags & vpGPSSpeed) { // speed/altitude: @@ -668,6 +644,30 @@ void vp_announceGPSInfo(vpGPSInfoFlags_t gpsInfoFlags) addSilenceIfNeeded(flags); } + if (gpsInfoFlags & vpGPSLatitude) + { + // lat/long + snprintf(buffer, 16, "%8.6f", state.gps_data.latitude); + removeUnnecessaryZerosFromVoicePrompts(buffer); + vp_queuePrompt(PROMPT_LATITUDE); + vp_queueString(buffer, vpAnnounceCommonSymbols); + vp_queuePrompt(PROMPT_NORTH); + } + + if (gpsInfoFlags & vpGPSLongitude) + { + float longitude = state.gps_data.longitude; + voicePrompt_t direction = (longitude < 0) ? PROMPT_WEST : PROMPT_EAST; + longitude = (longitude < 0) ? -longitude : longitude; + snprintf(buffer, 16, "%8.6f", longitude); + removeUnnecessaryZerosFromVoicePrompts(buffer); + + vp_queuePrompt(PROMPT_LONGITUDE); + vp_queueString(buffer, vpAnnounceCommonSymbols); + vp_queuePrompt(direction); + addSilenceIfNeeded(flags); + } + if (gpsInfoFlags & vpGPSSatCount) { vp_queuePrompt(PROMPT_SATELLITES);