From c25d6e974f7b8f9f74fb1c95f2f6337372d22eaf Mon Sep 17 00:00:00 2001 From: geeksville Date: Thu, 18 Jun 2020 11:22:38 -0700 Subject: [PATCH] sometimes first read might return 0 for EITHER lat or lon --- src/gps/UBloxGPS.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gps/UBloxGPS.cpp b/src/gps/UBloxGPS.cpp index 522b7843..472dba1c 100644 --- a/src/gps/UBloxGPS.cpp +++ b/src/gps/UBloxGPS.cpp @@ -117,7 +117,7 @@ The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of s altitude = ublox.getAltitude() / 1000; // in mm convert to meters 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 + hasValidLocation = (latitude != 0) && (longitude != 0); // bogus lat lon is reported as 0 or 0 (can be bogus just for one) if (hasValidLocation) { wantNewLocation = false; notifyObservers(NULL);