mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Merge pull request #2897 from PX4/master_uavcan_time_base
Update uavcan_main.cpp
This commit is contained in:
commit
f5d399c9bd
@ -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));
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user