From af5ac32048dc1a6bed56ef041652e077b1b80aec Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Tue, 30 Jan 2024 17:44:08 -0600 Subject: [PATCH] Re-order GPS check to eliminate TOO old message (#3152) --- src/gps/GPS.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index 592fc69cf..bc186c181 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -1115,6 +1115,10 @@ bool GPS::lookForLocation() reader.date.age(), reader.time.age()); #endif // GPS_EXTRAVERBOSE + // Is this a new point or are we re-reading the previous one? + if (!reader.location.isUpdated()) + return false; + // check if a complete GPS solution set is available for reading // tinyGPSDatum::age() also includes isValid() test // FIXME @@ -1127,10 +1131,6 @@ bool GPS::lookForLocation() return false; } - // Is this a new point or are we re-reading the previous one? - if (!reader.location.isUpdated()) - return false; - // We know the solution is fresh and valid, so just read the data auto loc = reader.location.value();