mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 03:53:33 +08:00
STM32: Fixed critical sections, removed clock interface for can driver
This commit is contained in:
@@ -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); }
|
||||
|
||||
Reference in New Issue
Block a user