Wiselib
|
Basic Concept for Timer. More...
Public Member Functions | |
template<typename T , void(T::*)(void *) TMethod> | |
int | set_timer (millis_t millis, T *obj_pnt, void *userdata) |
Register timer event in millis ms. | |
Public Attributes | |
typedef | OsModel |
Type of Os Concept which has been set for the timer. | |
typedef | millis_t |
Internally used type for millisecond representation. |
Basic Concept for Timer.
Another important feature when generalizing OS functionality is the registration of timer events, which is covered with the timer concept. It provides the basic type OsModel?, and it defines of which type the amount of milliseconds is given. Note that using a uint16_t would only result in approximately 60 seconds.
The important method is set_timer, which awaits among other parameters the amount of milliseconds after which the given callback function is called, and a void pointer to arbitrary data that is passed to the callback function when the timer expires.
int concepts::Timer_concept::set_timer | ( | millis_t | millis, |
T * | obj_pnt, | ||
void * | userdata | ||
) |
Register timer event in millis ms.
When timer event fires, userdata is passed as parameter. TMethod shall only be called repeadetly if set_timer is called from TMethod, i.e. no automatic repetition.
Internally used type for millisecond representation.
typedef concepts::Timer_concept::OsModel |
Type of Os Concept which has been set for the timer.