mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-02 11:55:56 +00:00
Update screen.cpp for for crash when gps gets lock
Update screen.cpp for for crash when gps gets a lock
This commit is contained in:
parent
caeea41867
commit
b6f71ca1db
@ -250,7 +250,7 @@ static void drawGPScoordinates(OLEDDisplay *display, int16_t x, int16_t y, const
|
|||||||
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 {
|
||||||
char coordinateLine[20];
|
char coordinateLine[22];
|
||||||
sprintf(coordinateLine, "%f %f", gps->getLatitude() * 1e-7, gps->getLongitude() * 1e-7);
|
sprintf(coordinateLine, "%f %f", gps->getLatitude() * 1e-7, gps->getLongitude() * 1e-7);
|
||||||
display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(coordinateLine))) / 2, y, coordinateLine);
|
display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(coordinateLine))) / 2, y, coordinateLine);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user