Use int based lat/long from now on in the device code

for https://github.com/meshtastic/Meshtastic-device/issues/124
This commit is contained in:
geeksville
2020-05-04 08:09:08 -07:00
parent 29fd8dc7a5
commit 9b309fe0a0
8 changed files with 31 additions and 38 deletions
+4 -4
View File
@@ -48,7 +48,7 @@ void GPS::setup()
isConnected = ublox.begin(_serial_gps);
if (isConnected) {
DEBUG_MSG("Connected to GPS successfully\n");
DEBUG_MSG("Connected to UBLOX GPS successfully\n");
bool factoryReset = false;
bool ok;
@@ -191,10 +191,10 @@ The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of s
if ((fixtype >= 3 && fixtype <= 4) && ublox.getP()) // rd fixes only
{
// we only notify if position has changed
latitude = ublox.getLatitude() * 1e-7;
longitude = ublox.getLongitude() * 1e-7;
latitude = ublox.getLatitude();
longitude = ublox.getLongitude();
altitude = ublox.getAltitude() / 1000; // in mm convert to meters
DEBUG_MSG("new gps pos lat=%f, lon=%f, alt=%d\n", latitude, longitude, altitude);
DEBUG_MSG("new gps pos lat=%f, lon=%f, alt=%d\n", latitude * 1e-7, longitude * 1e-7, altitude);
hasValidLocation = (latitude != 0) || (longitude != 0); // bogus lat lon is reported as 0,0
if (hasValidLocation) {