From c2f349c93d06745dd3ccbf7d4efed06ec5d791cc Mon Sep 17 00:00:00 2001 From: vk7js <58905135+vk7js@users.noreply.github.com> Date: Thu, 15 Sep 2022 22:01:48 +1000 Subject: [PATCH] More improvements to auto GPS screen readout Read fix quality and type changes. Read satellite count changes. Reduced minimum time between readouts to 8 seconds. say km/h instead of kmh for speed. --- openrtx/src/core/voicePromptUtils.c | 3 ++- openrtx/src/ui/ui.c | 15 +++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/openrtx/src/core/voicePromptUtils.c b/openrtx/src/core/voicePromptUtils.c index b773c614..b7aa8000 100644 --- a/openrtx/src/core/voicePromptUtils.c +++ b/openrtx/src/core/voicePromptUtils.c @@ -649,7 +649,8 @@ void vp_announceGPSInfo(vpGPSInfoFlags_t gpsInfoFlags) // speed/altitude: snprintf(buffer, 16, "%4.1fkm/h", state.gps_data.speed); vp_queuePrompt(PROMPT_SPEED); - vp_queueString(buffer, vpAnnounceCommonSymbols); + vp_queueString(buffer, + vpAnnounceCommonSymbols|vpAnnounceLessCommonSymbols); } if (gpsInfoFlags & vpGPSAltitude) diff --git a/openrtx/src/ui/ui.c b/openrtx/src/ui/ui.c index 5f0850f2..a36dd6e9 100644 --- a/openrtx/src/ui/ui.c +++ b/openrtx/src/ui/ui.c @@ -1137,17 +1137,18 @@ void ui_saveState() static float priorGPSSpeed = 0; static float priorGPSAltitude = 0; static float priorGPSDirection = 500; // impossible value init. +static uint8_t priorGPSFixQuality= 0; +static uint8_t priorGPSFixType = 0; +static uint8_t priorSatellitesInView = 0; static uint32_t vpGPSLastUpdate = 0; static vpGPSInfoFlags_t GetGPSDirectionOrSpeedChanged() { if (!state.settings.gps_enabled) return vpGPSNone; - if (state.gps_data.fix_quality == 0 || state.gps_data.fix_quality >= 6) - return vpGPSNone; - + uint32_t now = getTick(); - if (now - vpGPSLastUpdate < 10000) + if (now - vpGPSLastUpdate < 8000) return vpGPSNone; vpGPSInfoFlags_t whatChanged= vpGPSNone; @@ -1185,6 +1186,12 @@ static vpGPSInfoFlags_t GetGPSDirectionOrSpeedChanged() priorGPSDirection = state.gps_data.tmg_true; } + if (state.gps_data.satellites_in_view != priorSatellitesInView) + { + whatChanged |= vpGPSSatCount; + priorSatellitesInView = state.gps_data.satellites_in_view; + } + if (whatChanged) vpGPSLastUpdate=now;