Index

Cooperating Sequential Tasks

  1. Introduction
    1. Arduino
    2. Interrupts
  2. Simple Tasks
  3. Multiple Tasks
  4. Communicating Tasks
  5. Communicating Values
  6. Synchronising Tasks
  7. Buffered Communication
  8. Multiple Senders
  9. Conditional Tasks
  10. Transput
  11. Implementation
    1. Common Data
    2. Tasks
    3. task_builder
    4. task
    5. channel
    6. virtual_machine
    7. set
    8. queue
    9. clock
    10. standard
    11. Adjusting Limits

standard



The standard component provides a number of convenience definitions, mainly associated with the use of the Serial port for debugging purposes.

Data Structure

The null constant is used to represent null values for pointers etc.

const int null =  0;


Functions

void init_monitor();


The init_monitor function called without a parameter disables the standard Serial connection and suppresses any output from the print and println functions below. This is called directly by the init_serial function defined in the Tasks interface.

void init_monitor(int baud_rate);


The init_monitor function called with an integer parameter enables the standard Serial connection and allows output to be generated by the print and println functions below. This is called directly by the init_serial function with an integer parameter defined in the Tasks interface.

bool serial_ready();


This function returns true if init_monitor has been called with an integer parameter. Calling init_monitor without a parameter will cause serial_ready to return false.

void print(String caption);


Outputs a String to the standard serial port if serial_ready returns true, otherwise no output is produced.

void print(int value);


Outputs an integer to the standard serial port if serial_ready returns true, otherwise no output is produced.

void println(String caption);


Outputs a String, followed by a line break, to the standard serial port if serial_ready returns true, otherwise no output is produced.

void println(String caption, int value);


Produces output in the format “caption: value”, followed by a line break, to the standard serial port if serial_ready returns true, otherwise no output is produced. In the output “caption” is replaced by the value of the String parameter and “value” is replaced by the value of the integer parameter.