From 6178d2a35ff4a788578fef4f5c0e40288eba7857 Mon Sep 17 00:00:00 2001 From: Jason Reiss Date: Tue, 30 Nov 2021 08:41:27 -0600 Subject: Update loragw_gps.c - only update during calibration or when slope is within acceptable range. --- libloragw/src/loragw_gps.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libloragw/src/loragw_gps.c b/libloragw/src/loragw_gps.c index 68a65ac..7eece2c 100644 --- a/libloragw/src/loragw_gps.c +++ b/libloragw/src/loragw_gps.c @@ -644,20 +644,20 @@ int lgw_gps_sync(struct tref *ref, uint32_t count_us, struct timespec gps_time) slope = 0.0; } - update = ((slope >= MINUS_10PPM && slope <= PLUS_10PPM) || cnt_diff > 1.5); + update = (slope >= MINUS_10PPM && slope <= PLUS_10PPM); if (!calibrating && utc_diff < 10.0) { return LGW_GPS_ERROR; } if (calibrating && !update && utc_diff > 1.5) { - update = true; + update = true; } else if (update) { calibrating = false; } } else { - update = true; + update = true; slope = 0.0; } -- cgit v1.2.3