TaskManagerIO
Loading...
Searching...
No Matches
TaskManagerIO.h File Reference

Task manager is a simple co-routine style implementation for Arduino which supports scheduling work to be done at a given time, repeating tasks, interrupt marshalling and events. It is generally thread safe such that code outside of task manager can add, remove and manage tasks even while task manager is running. More...

Go to the source code of this file.

Classes

class  InterruptAbstraction
class  TimePeriod
class  TaskManager

Typedefs

typedef void(* RawIntHandler) ()
typedef void(* InterruptFn) (pintype_t pin)

Functions

void yield ()
uint32_t millis ()
uint32_t micros ()
TimePeriod repeatSeconds (uint32_t seconds)
TimePeriod repeatMillis (uint32_t millis)
TimePeriod repeatMicros (uint32_t micros)
TimePeriod onceSeconds (uint32_t seconds)
TimePeriod onceMillis (uint32_t millis)
TimePeriod onceMicros (uint32_t micros)

Variables

TaskManager taskManager

Detailed Description

Task manager is a simple co-routine style implementation for Arduino which supports scheduling work to be done at a given time, repeating tasks, interrupt marshalling and events. It is generally thread safe such that code outside of task manager can add, remove and manage tasks even while task manager is running.

Typedef Documentation

◆ RawIntHandler

typedef void(* RawIntHandler) ()

the definition of an interrupt handler function, to be called back when an interrupt occurs.

◆ InterruptFn

typedef void(* InterruptFn) (pintype_t pin)

Definition of a function to be called back when an interrupt is detected, marshalled by task manager into a task. The pin that caused the interrupt is passed in the parameter on a best efforts basis.

Parameters
pinthe pin on which the interrupt occurred (best efforts)

Function Documentation

◆ yield()

void yield ( )

This defines the yield function for environments that don't have the function, as per framework on Arduino

◆ millis()

uint32_t millis ( )

MBED ONLY: This defines the millis function for environments that don't have the function, as per framework on Arduino

◆ micros()

uint32_t micros ( )

MBED ONLY: This defines the micros function as per framework on Arduino on environments that don't have it

◆ repeatSeconds()

TimePeriod repeatSeconds ( uint32_t seconds)
inline

Create a repeating time period for scheduling in seconds

Parameters
secondsthe number of seconds to schedule in
Returns
the time period for scheduling.

◆ repeatMillis()

TimePeriod repeatMillis ( uint32_t millis)
inline

Create a repeating time period for scheduling in millis

Parameters
millisthe number of milliseconds to schedule in
Returns
the time period for scheduling.

◆ repeatMicros()

TimePeriod repeatMicros ( uint32_t micros)
inline

Create a repeating time period for scheduling in microseconds

Parameters
microsthe number of microseconds to schedule in
Returns
the time period for scheduling.

◆ onceSeconds()

TimePeriod onceSeconds ( uint32_t seconds)
inline

Create a time period for scheduling once in seconds

Parameters
secondsthe number of seconds to schedule in
Returns
the time period for scheduling.

◆ onceMillis()

TimePeriod onceMillis ( uint32_t millis)
inline

Create a time period for scheduling once in milliseconds

Parameters
millisthe number of milliseconds to schedule in
Returns
the time period for scheduling.

◆ onceMicros()

TimePeriod onceMicros ( uint32_t micros)
inline

Create a time period for scheduling once in microseconds

Parameters
millisthe number of microseconds to schedule in
Returns
the time period for scheduling.

Variable Documentation

◆ taskManager

TaskManager taskManager
extern

the global task manager, this would normally be associated with the main runLoop.