Bare Metal Programming Tool Kit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Friends | List of all members
bmptk::rtos::clock Class Reference

free-running clock, ticks at a fixed frequency More...

#include <rtos.h>

Inheritance diagram for bmptk::rtos::clock:

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.
 

Detailed Description

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.

TBW

Definition at line 780 of file rtos.h.

Constructor & Destructor Documentation

bmptk::rtos::clock::clock ( task t,
time  interval,
const char *  name = "" 
)

create a clock for task t, specify interval and name

The name is used for debugging and statistics.

Member Function Documentation

void bmptk::rtos::clock::clear ( )
inline

clear the waitable within the clock

Note that this does not stop the clock.

Definition at line 795 of file rtos.h.


The documentation for this class was generated from the following file: