From 76526b0b151a488561a3cd45cce912f1caf865eb Mon Sep 17 00:00:00 2001 From: Edgar Bonet Date: Fri, 21 Feb 2020 21:04:56 +0100 Subject: [PATCH] Document time limits of secondsSince*() The values returned by Adafruit_GPS::secondsSince{Fix,Time,Date}() wrap around if larger than 2^32 ms. --- src/Adafruit_GPS.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Adafruit_GPS.cpp b/src/Adafruit_GPS.cpp index 5563c4e..ff44207 100644 --- a/src/Adafruit_GPS.cpp +++ b/src/Adafruit_GPS.cpp @@ -637,7 +637,10 @@ bool Adafruit_GPS::wakeup(void) { /**************************************************************************/ /*! - @brief Time in seconds since the last position fix was obtained. + @brief Time in seconds since the last position fix was obtained. The + time returned is limited to 2^32 milliseconds, which is about 49.7 days. + It will wrap around to zero if no position fix is received + for this long. @return nmea_float_t value in seconds since last fix. */ /**************************************************************************/ @@ -647,7 +650,9 @@ nmea_float_t Adafruit_GPS::secondsSinceFix() { /**************************************************************************/ /*! - @brief Time in seconds since the last GPS time was obtained. + @brief Time in seconds since the last GPS time was obtained. The time + returned is limited to 2^32 milliseconds, which is about 49.7 days. It + will wrap around to zero if no GPS time is received for this long. @return nmea_float_t value in seconds since last GPS time. */ /**************************************************************************/ @@ -657,7 +662,9 @@ nmea_float_t Adafruit_GPS::secondsSinceTime() { /**************************************************************************/ /*! - @brief Time in seconds since the last GPS date was obtained. + @brief Time in seconds since the last GPS date was obtained. The time + returned is limited to 2^32 milliseconds, which is about 49.7 days. It + will wrap around to zero if no GPS date is received for this long. @return nmea_float_t value in seconds since last GPS date. */ /**************************************************************************/