avr-classes
|
#include <timerservicehost.h>
Public Member Functions | |
TimerServiceHost (Timer *timer) | |
bool | add (TimerService *service) |
void | remove (TimerService *service) |
virtual void | onOutputCompareMatch (void) override |
![]() | |
virtual void | onOverflow (void) |
The TimerServiceHost template class is designed to host services derived from Service which can be added and removed at runtime. The host registers as interrupt handler at the Timer instance passed to the constructor, forwarding all Output Compare Match interrupts to the Service::onTick methods. The timer services can implement specific behavior, such as cyclic event creation or time measuring.
SERVICECOUNT | Maximum number of services that can be registered. |
|
inline |
Constructor.
timer | Pointer to timer instance used by this TimeServiceHost instance. |
|
inline |
Adds a service. A service can be added only once.
service | Service to add. |
|
inlineoverridevirtual |
Handler for Output Compare Match interrupt.
Reimplemented from Timer::InterruptHandler.
|
inline |
Removes a service.
service | Service to remove. |