From 90122b0c7aa2f681b0fbd7847104e82581677d12 Mon Sep 17 00:00:00 2001 From: Silvano Seva Date: Wed, 24 Mar 2021 12:28:45 +0100 Subject: [PATCH] Fixed bug in gps task which made it setting time and date even whithout GPS fix. --- openrtx/src/gps.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openrtx/src/gps.c b/openrtx/src/gps.c index 7edd6894..20a0dfc3 100644 --- a/openrtx/src/gps.c +++ b/openrtx/src/gps.c @@ -66,8 +66,9 @@ void gps_taskFunc(char *line, __attribute__((unused)) int len, state_t *state) state->gps_data.timestamp.year = frame.date.year; } - // Synchronize RTC with GPS UTC clock - if((state->settings.gps_set_time) && (!isRtcSyncronised)) + // Synchronize RTC with GPS UTC clock, only when fix is done + if((state->settings.gps_set_time) && + (state->gps_data.fix_quality > 0) && (!isRtcSyncronised)) { rtc_setTime(state->gps_data.timestamp); isRtcSyncronised = true;