diff --git a/src/config.h b/src/config.h index 339a7ad..ec4018c 100644 --- a/src/config.h +++ b/src/config.h @@ -57,6 +57,9 @@ // Threshold for time-synchronized modes regarding how far from scheduled transmission time the transmission is still allowed #define RADIO_TIME_SYNC_THRESHOLD_MS 2000 +// Number of leap seconds to add to the raw GPS time reported by the GPS chip (see https://timetoolsltd.com/gps/what-is-gps-time/ for more info) +#define GPS_TIME_LEAP_SECONDS 18 + // Enable this setting to require 3D fix (altitude required, enable for airborne use), otherwise 2D fix is enough #define GPS_REQUIRE_3D_FIX true diff --git a/src/radio.c b/src/radio.c index 877d5ed..f1c2277 100644 --- a/src/radio.c +++ b/src/radio.c @@ -712,7 +712,7 @@ bool radio_handle_time_sync() return false; } - uint32_t time_millis = gps.time_of_week_millis; + uint32_t time_millis = gps.time_of_week_millis + (GPS_TIME_LEAP_SECONDS * 1000); if (time_millis == radio_previous_time_sync_scheduled) { // The GPS chip has not provided an updated time yet for some reason