From 8eaf213eddd3025133d8ba6471324c14a2f956a5 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Wed, 23 Sep 2015 05:32:14 -1000 Subject: [PATCH] Update uavcan_main.cpp --- src/modules/uavcan/uavcan_main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/uavcan/uavcan_main.cpp b/src/modules/uavcan/uavcan_main.cpp index b12f9e0211..4b782eb404 100644 --- a/src/modules/uavcan/uavcan_main.cpp +++ b/src/modules/uavcan/uavcan_main.cpp @@ -766,9 +766,10 @@ int UavcanNode::run() /* When we have a system wide notion of time update (i.e the transition from the initial * System RTC setting to the GPS) we would call uavcan_stm32::clock::setUtc() when that - * happens, but for now we use adjustUtc with a correction of 0 + * happens, but for now we use adjustUtc with a correction of the hrt so that the + * time bases are the same */ - uavcan_stm32::clock::adjustUtc(uavcan::UtcDuration::fromUSec(0)); + uavcan_stm32::clock::adjustUtc(uavcan::UtcDuration::fromUSec(hrt_absolute_time())); _master_timer.setCallback(TimerCallback(this, &UavcanNode::handle_time_sync)); _master_timer.startPeriodic(uavcan::MonotonicDuration::fromMSec(1000));