Superrefactoring - all time values were replaced with new safer classes from uavcan/time.hpp; generated types were moved away from anonymous namespaces because this makes it impossible to use a type from different compilation units. Some less vital fixes are to follow - see the next few commits

This commit is contained in:
Pavel Kirienko
2014-03-11 14:41:48 +04:00
parent 633fa9d8bd
commit 65a4dcc2cf
48 changed files with 654 additions and 565 deletions
+8 -5
View File
@@ -6,9 +6,12 @@
#pragma once
#include <stdint.h>
#include <uavcan/internal/impl_constants.hpp>
#include <uavcan/time.hpp>
namespace uavcan
{
/**
* System clock interface - monotonic and UTC.
* Note that this library uses microseconds for all time related values (timestamps, deadlines, delays),
@@ -21,19 +24,19 @@ public:
virtual ~ISystemClock() { }
/**
* Monototic system clock in microseconds.
* Monototic system clock.
* This shall never jump during UTC timestamp adjustments; the base time is irrelevant.
* On POSIX systems use clock_gettime() with CLOCK_MONOTONIC.
*/
virtual uint64_t getMonotonicMicroseconds() const = 0;
virtual MonotonicTime getMonotonic() const = 0;
/**
* UTC clock in microseconds.
* UTC clock.
* This can jump when the UTC timestamp is being adjusted.
* Return 0 if the UTC time is not available yet (e.g. the device just started up with no battery clock).
* On POSIX systems use gettimeofday().
*/
virtual uint64_t getUtcMicroseconds() const = 0;
virtual UtcTime getUtc() const = 0;
/**
* Set the UTC system clock.
@@ -41,7 +44,7 @@ public:
* @param [in] offset Current UTC time error. More precise than just timestamp, use it if possible.
* For POSIX refer to adjtime(), settimeofday().
*/
virtual void adjustUtcMicroseconds(uint64_t new_timestamp_usec, int64_t offset_usec) = 0;
virtual void adjustUtc(UtcTime new_time, UtcDuration offset) = 0;
};
}