From 4e1689df51cb8b5ecb1cd30a4a9f6978ce0ca1c7 Mon Sep 17 00:00:00 2001 From: vk7js <58905135+vk7js@users.noreply.github.com> Date: Tue, 13 Sep 2022 16:14:30 +1000 Subject: [PATCH] Cleaned up GPS direction info so we say north, east, south, west when the tmg is within a close enough range. --- openrtx/src/core/voicePromptUtils.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/openrtx/src/core/voicePromptUtils.c b/openrtx/src/core/voicePromptUtils.c index 8ce39aa4..15118528 100644 --- a/openrtx/src/core/voicePromptUtils.c +++ b/openrtx/src/core/voicePromptUtils.c @@ -640,10 +640,27 @@ void vp_announceGPSInfo(vpGPSInfoFlags_t gpsInfoFlags) if (gpsInfoFlags & vpGPSDirection) { - snprintf(buffer, 16, "%3.1f", state.gps_data.tmg_true); vp_queuePrompt(PROMPT_COMPASS); - vp_queueString(buffer, vpAnnounceCommonSymbols); - vp_queuePrompt(PROMPT_DEGREES); + + if (state.gps_data.tmg_true < 3 || state.gps_data.tmg_true > 357) + { + vp_queuePrompt(PROMPT_NORTH); + } + else if (state.gps_data.tmg_true > 87 || state.gps_data.tmg_true < 93) + { + vp_queuePrompt(PROMPT_EAST); + } + else if (state.gps_data.tmg_true > 177 || state.gps_data.tmg_true < 183) + { + vp_queuePrompt(PROMPT_WEST); + } + else + { + snprintf(buffer, 16, "%3.1f", state.gps_data.tmg_true); + vp_queueString(buffer, vpAnnounceCommonSymbols); + vp_queuePrompt(PROMPT_DEGREES); + } + addSilenceIfNeeded(flags); }