STM32: Fixed critical sections, removed clock interface for can driver

This commit is contained in:
Pavel Kirienko
2014-04-05 00:11:21 +04:00
parent f66338d329
commit 6341be88fd
5 changed files with 34 additions and 43 deletions
@@ -17,11 +17,6 @@ namespace clock
*/
void init();
/**
* For CAN timestamping.
*/
uavcan::uint64_t getUtcUSecFromInterrupt();
/**
* For general usage.
*/
@@ -48,28 +43,17 @@ uavcan::uint32_t getUtcAjdustmentJumpCount();
}
/**
* Clock interface for CAN driver.
*/
class ICanTimestampingClock : public uavcan::ISystemClock
{
public:
virtual uavcan::uint64_t getUtcUSecFromInterrupt() const = 0;
};
/**
* Trivial system clock implementation; can be redefined by the application.
* Uses a simple 16-bit hardware timer for both UTC and monotonic clocks.
*/
class SystemClock : public ICanTimestampingClock, uavcan::Noncopyable
class SystemClock : public uavcan::ISystemClock, uavcan::Noncopyable
{
SystemClock() { }
public:
static SystemClock& instance();
virtual uavcan::uint64_t getUtcUSecFromInterrupt() const { return clock::getUtcUSecFromInterrupt(); }
virtual uavcan::MonotonicTime getMonotonic() const { return clock::getMonotonic(); }
virtual uavcan::UtcTime getUtc() const { return clock::getUtc(); }
virtual void adjustUtc(uavcan::UtcDuration adjustment) { clock::adjustUtc(adjustment); }