Bare Metal Programming Tool Kit
|
free-running clock, ticks at a fixed frequency More...
#include <rtos.h>
Public Member Functions | |
clock (task *t, time interval, const char *name="") | |
create a clock for task t, specify interval and name | |
void | clear () |
clear the waitable within the clock | |
time | interval () |
the interval of the timer | |
void | print (std::ostream &s, bool header=true) const |
print the clock (for debugging) | |
Friends | |
void | add (clock *c) |
void | beat () |
void | print (std::ostream &stream) |
prints statistics about the tasks to the stream. | |
free-running clock, ticks at a fixed frequency
A clock is a waitable which is automatically sets itself at fixed intervals. The interval between these moments is specified when the clock is created.
The example below again shows the left-shifting and polarity flipping Kitt display, but the actions are now caused by two clocks. Note that unlike the timers examples the clocks are never explictly started.
create a clock for task t, specify interval and name
The name is used for debugging and statistics.
|
inline |