kopia lustrzana https://github.com/OpenRTX/OpenRTX
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.md1702
rodzic
cf45f7ee81
commit
c2f349c93d
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue