sforkowany z mirror/meshtastic-firmware
Merge pull request #1012 from mc-hamster/master
Update to show fixed gps alternating with location info1.2-legacy
commit
476c6f25ce
|
@ -428,16 +428,14 @@ static void drawGPScoordinates(OLEDDisplay *display, int16_t x, int16_t y, const
|
||||||
auto gpsFormat = radioConfig.preferences.gps_format;
|
auto gpsFormat = radioConfig.preferences.gps_format;
|
||||||
String displayLine = "";
|
String displayLine = "";
|
||||||
|
|
||||||
if (radioConfig.preferences.fixed_position) {
|
if (!gps->getIsConnected() && !radioConfig.preferences.fixed_position) {
|
||||||
displayLine = "Fixed GPS";
|
|
||||||
display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(displayLine))) / 2, y, displayLine);
|
|
||||||
} else if (!gps->getIsConnected() && !radioConfig.preferences.fixed_position) {
|
|
||||||
displayLine = "No GPS Module";
|
displayLine = "No GPS Module";
|
||||||
display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(displayLine))) / 2, y, displayLine);
|
display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(displayLine))) / 2, y, displayLine);
|
||||||
} else if (!gps->getHasLock() && !radioConfig.preferences.fixed_position) {
|
} else if (!gps->getHasLock() && !radioConfig.preferences.fixed_position) {
|
||||||
displayLine = "No GPS Lock";
|
displayLine = "No GPS Lock";
|
||||||
display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(displayLine))) / 2, y, displayLine);
|
display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(displayLine))) / 2, y, displayLine);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (gpsFormat != GpsCoordinateFormat_GpsFormatDMS) {
|
if (gpsFormat != GpsCoordinateFormat_GpsFormatDMS) {
|
||||||
char coordinateLine[22];
|
char coordinateLine[22];
|
||||||
geoCoord.updateCoords(int32_t(gps->getLatitude()), int32_t(gps->getLongitude()), int32_t(gps->getAltitude()));
|
geoCoord.updateCoords(int32_t(gps->getLatitude()), int32_t(gps->getLongitude()), int32_t(gps->getAltitude()));
|
||||||
|
@ -459,7 +457,17 @@ static void drawGPScoordinates(OLEDDisplay *display, int16_t x, int16_t y, const
|
||||||
geoCoord.getOSGREasting(), geoCoord.getOSGRNorthing());
|
geoCoord.getOSGREasting(), geoCoord.getOSGRNorthing());
|
||||||
}
|
}
|
||||||
|
|
||||||
display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(coordinateLine))) / 2, y, coordinateLine);
|
// If fixed position, display text "Fixed GPS" alternating with the coordinates.
|
||||||
|
if (radioConfig.preferences.fixed_position) {
|
||||||
|
if ((millis() / 10000) % 2) {
|
||||||
|
display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(coordinateLine))) / 2, y, coordinateLine);
|
||||||
|
} else {
|
||||||
|
display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth("Fixed GPS"))) / 2, y, "Fixed GPS");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(coordinateLine))) / 2, y, coordinateLine);
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
char latLine[22];
|
char latLine[22];
|
||||||
char lonLine[22];
|
char lonLine[22];
|
||||||
|
|
Ładowanie…
Reference in New Issue