From 56a860bef7b4b7a888ce2c7fc32035ec80008654 Mon Sep 17 00:00:00 2001 From: Jaaaky <43599380+Jaaaky@users.noreply.github.com> Date: Sat, 5 Feb 2022 12:31:42 +0300 Subject: [PATCH] AP_RTC: fix oldest_acceptable_date to be in micros Also update date to 2022-01-01 00:00 UTC --- libraries/AP_RTC/AP_RTC.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_RTC/AP_RTC.cpp b/libraries/AP_RTC/AP_RTC.cpp index 19fa8dabbb..aa646cb9dd 100644 --- a/libraries/AP_RTC/AP_RTC.cpp +++ b/libraries/AP_RTC/AP_RTC.cpp @@ -41,7 +41,7 @@ const AP_Param::GroupInfo AP_RTC::var_info[] = { void AP_RTC::set_utc_usec(uint64_t time_utc_usec, source_type type) { - const uint64_t oldest_acceptable_date = 1546300800000; // 2019-01-01 0:00 + const uint64_t oldest_acceptable_date_us = 1640995200ULL*1000*1000; // 2022-01-01 0:00 if (type >= rtc_source_type) { // e.g. system-time message when we've been set by the GPS @@ -54,7 +54,7 @@ void AP_RTC::set_utc_usec(uint64_t time_utc_usec, source_type type) } // don't allow old times - if (time_utc_usec < oldest_acceptable_date) { + if (time_utc_usec < oldest_acceptable_date_us) { return; }