From 3a74ad9105225572394603c699f8e5b091f066c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Thu, 19 Apr 2018 13:16:14 -0300 Subject: [PATCH] AP_HAL_Linux: Add system_time_was_set to set system_time once MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- libraries/AP_HAL_Linux/Util.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/AP_HAL_Linux/Util.cpp b/libraries/AP_HAL_Linux/Util.cpp index afafdd8bbe..c37c2f177f 100644 --- a/libraries/AP_HAL_Linux/Util.cpp +++ b/libraries/AP_HAL_Linux/Util.cpp @@ -97,6 +97,8 @@ void Util::_toneAlarm_timer_tick() { void Util::set_system_clock(uint64_t time_utc_usec) { #if CONFIG_HAL_BOARD_SUBTYPE != HAL_BOARD_SUBTYPE_LINUX_NONE + _system_time_was_set = true; + timespec ts; ts.tv_sec = time_utc_usec/1.0e6; ts.tv_nsec = (time_utc_usec % 1000000) * 1000;