Cleaned up GPS direction info so we say north, east, south, west when the tmg is within a close enough range.

This commit is contained in:
vk7js 2022-09-13 16:14:30 +10:00 committed by Silvano Seva
parent 5829df6dd3
commit 4e1689df51
1 changed files with 20 additions and 3 deletions

View File

@ -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);
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);
}