Added a few more voice prompts for the GPS screen: latitude, longitude, north, south, east,west, speed, altitude.

md1702
vk7js 2022-05-19 17:00:21 +10:00 zatwierdzone przez Silvano Seva
rodzic 0a4ed4009c
commit 4b604e255f
2 zmienionych plików z 17 dodań i 3 usunięć

Wyświetl plik

@ -124,6 +124,14 @@ PROMPT_TIMESLOT, // timeslot
PROMPT_COLORCODE, // color code
PROMPT_TONE, // tone
PROMPT_CONTACT, // contact
PROMPT_NORTH, // north
PROMPT_SOUTH, // south
PROMPT_EAST, // east
PROMPT_WEST, // west
PROMPT_LATITUDE, // latitude
PROMPT_LONGITUDE, // longitude
PROMPT_SPEED, // speed
PROMPT_ALTITUDE, // altitude
PROMPT_CHARACTER, // character
PROMPT_SPACE, // space
PROMPT_PERCENT, // Percent

Wyświetl plik

@ -492,16 +492,22 @@ void announceGPSInfo(VoicePromptQueueFlags_T flags)
}
// lat/long
char buffer[16] = "\0";
snprintf(buffer, 16, "%8.6f N", state.gps_data.latitude);
vpQueuePrompt(PROMPT_LATITUDE);
snprintf(buffer, 16, "%8.6f", state.gps_data.latitude);
vpQueueString(buffer, vpAnnounceCommonSymbols);
vpQueuePrompt(PROMPT_NORTH);
float longitude = state.gps_data.longitude;
const char *direction = (longitude < 0) ? "W" : "E";
voicePrompt_t direction = (longitude < 0) ? PROMPT_WEST : PROMPT_EAST;
longitude = (longitude < 0) ? -longitude : longitude;
snprintf(buffer, 16, "%8.6f %s", longitude, direction);
snprintf(buffer, 16, "%8.6f", longitude);
vpQueuePrompt(PROMPT_LONGITUDE);
vpQueueString(buffer, vpAnnounceCommonSymbols);
vpQueuePrompt(direction);
// speed/altitude:
vpQueuePrompt(PROMPT_SPEED);
snprintf(buffer, 16, "%4.1fkm/h", state.gps_data.speed);
vpQueueString(buffer, vpAnnounceCommonSymbols);
vpQueuePrompt(PROMPT_ALTITUDE);
snprintf(buffer, 16, "%4.1fm", state.gps_data.altitude);
vpQueueString(buffer, vpAnnounceCommonSymbols);