Bare Metal Programming Tool Kit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Classes | Functions | Variables
bmptk::rtos Namespace Reference

non-preememptive rtos More...

Classes

class  event
 set of things that can happen, or a thing that has happened More...
 
class  waitable
 abstract thing that a task can wait for More...
 
class  flag
 basic synchronisation mechanism. More...
 
class  task
 an independent thread of execution More...
 
class  timer
 one-short timer More...
 
class  clock
 free-running clock, ticks at a fixed frequency More...
 
class  pool
 rtos private implementation class More...
 
class  mutex
 mutual execlusion semaphore More...
 
class  mailbox
 synchronous handling over of a data item More...
 
class  channel
 waitable data queue More...
 

Functions

void run ()
 run the rtos scheduler
 
taskcurrent_task ()
 returns (a pointer to) the currently executing task
 
void print (std::ostream &stream)
 prints statistics about the tasks to the stream.
 
void statistics_clear ()
 clears the statistics.
 
void display_statistics ()
 print the statistics
 
std::ostream & operator<< (std::ostream &s, const bmptk::rtos::task &t)
 print information about a task
 
std::ostream & operator<< (std::ostream &s, const bmptk::rtos::flag &f)
 print information about a flag
 
std::ostream & operator<< (std::ostream &s, const bmptk::rtos::event &e)
 print information about an event
 
std::ostream & operator<< (std::ostream &s, const bmptk::rtos::callback &c)
 print information about a callback
 
std::ostream & operator<< (std::ostream &s, const bmptk::rtos::timer &t)
 print information about a timer
 
std::ostream & operator<< (std::ostream &s, const bmptk::rtos::clock &c)
 print information about a clock
 
std::ostream & operator<< (std::ostream &s, const bmptk::rtos::channel_base &c)
 print information about a channel
 
std::ostream & operator<< (std::ostream &s, const bmptk::rtos::mutex &m)
 print information about a mutex
 
std::ostream & operator<< (std::ostream &s, const bmptk::rtos::mailbox_base &m)
 print information about a mailbox
 
std::ostream & operator<< (std::ostream &s, const bmptk::rtos::pool_base &p)
 print information about a pool
 

Variables

const unsigned int BMPTK_RTOS_DEFAULT_STACK_SIZE = 2048
 the default task stack size
 
const unsigned int BMPTK_RTOS_MAX_PRIORITY = 10000
 the maximum user-defined taks priority
 

Detailed Description

non-preememptive rtos

This namespace provides a simple non-preemeptive (cooperative) rtos.

Function Documentation

task* bmptk::rtos::current_task ( )

returns (a pointer to) the currently executing task

Initially (before run is called) this function will return 0;

void bmptk::rtos::run ( )

run the rtos scheduler

When the tasks of an application have been created, the next (and for the main(), final) step is to call this function.

void bmptk::rtos::statistics_clear ( )

clears the statistics.

The task statistics are cumulative. Call this function to make a fresh start. The actual clearing will be done later, inside run(), when the current task has given up the processor. The effect is that the current timeslice is not reflected in the new statistics.