Skip to content

Commit

Permalink
Re-order GPS check to eliminate TOO old message (#3152)
Browse files Browse the repository at this point in the history
  • Loading branch information
jp-bennett authored Jan 30, 2024
1 parent 9586c68 commit af5ac32
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/gps/GPS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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();

Expand Down

0 comments on commit af5ac32

Please sign in to comment.