C++11 Timer API

This commit is contained in:
Pavel Kirienko
2014-03-27 13:52:41 +04:00
parent c4e0404d02
commit 5157f9182e
3 changed files with 87 additions and 4 deletions
+22 -1
View File
@@ -7,7 +7,9 @@
namespace uavcan
{
/*
* TimerBase
*/
void TimerBase::handleDeadline(MonotonicTime current)
{
assert(!isRunning());
@@ -45,4 +47,23 @@ void TimerBase::startPeriodic(MonotonicDuration period)
DeadlineHandler::startWithDelay(period);
}
/*
* Timer
*/
#if UAVCAN_CPP_VERSION >= UAVCAN_CPP11
void Timer::handleTimerEvent(const TimerEvent& event)
{
if (callback)
{
callback(event);
}
else
{
assert(0);
}
}
#endif
}