mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-04 05:05:19 +08:00
microRTPS: timesync: fix unit conversion
This commit is contained in:
@@ -142,8 +142,8 @@ public:
|
|||||||
@[end if]@
|
@[end if]@
|
||||||
|
|
||||||
inline int64_t getOffset() { return _offset_ns.load(); }
|
inline int64_t getOffset() { return _offset_ns.load(); }
|
||||||
inline void addOffset(uint64_t& timestamp) { timestamp = (timestamp * 1000LL + _offset_ns.load()) / 10000ULL; }
|
inline void addOffset(uint64_t& timestamp) { timestamp = (timestamp * 1000LL + _offset_ns.load()) / 1000ULL; }
|
||||||
inline void subtractOffset(uint64_t& timestamp) { timestamp = (timestamp * 1000LL - _offset_ns.load()) / 10000ULL; }
|
inline void subtractOffset(uint64_t& timestamp) { timestamp = (timestamp * 1000LL - _offset_ns.load()) / 1000ULL; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::atomic<int64_t> _offset_ns;
|
std::atomic<int64_t> _offset_ns;
|
||||||
|
|||||||
Reference in New Issue
Block a user