Add leap seconds to raw GPS time

pull/54/head
Mikael Nousiainen 2023-08-08 18:44:01 +03:00
rodzic 84c7a7d6c1
commit 767c1a2f54
2 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -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

Wyświetl plik

@ -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