forked from Archive/PX4-Autopilot
microRTPS: timesync: fix unit conversion
This commit is contained in:
parent
59869b2350
commit
a3487ab8a3
|
@ -142,8 +142,8 @@ public:
|
|||
@[end if]@
|
||||
|
||||
inline int64_t getOffset() { return _offset_ns.load(); }
|
||||
inline void addOffset(uint64_t& timestamp) { timestamp = (timestamp * 1000LL + _offset_ns.load()) / 10000ULL; }
|
||||
inline void subtractOffset(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()) / 1000ULL; }
|
||||
|
||||
private:
|
||||
std::atomic<int64_t> _offset_ns;
|
||||
|
|
Loading…
Reference in New Issue