#include <Scheduler.h>
|
static bool | begin (size_t stackSize) |
|
static bool | start (func_t taskSetup, func_t taskLoop, size_t stackSize=DEFAULT_STACK_SIZE) |
|
static bool | startLoop (func_t taskLoop, size_t stackSize=DEFAULT_STACK_SIZE) |
|
static void | yield () |
|
static size_t | stack () |
|
Definition at line 26 of file Scheduler.h.
typedef void(* SchedulerClass::func_t) () |
Function prototype (task setup and loop functions).
Definition at line 31 of file Scheduler.h.
bool SchedulerClass::begin |
( |
size_t |
stackSize | ) |
|
|
static |
Initiate scheduler and main task with given stack size. Should be called before start of any tasks if the main task requires a stack size other than the default main size. Returns true if successful otherwise false.
- Parameters
-
- Returns
- bool.
Definition at line 69 of file Scheduler.cpp.
void SchedulerClass::init |
( |
func_t |
setup, |
|
|
func_t |
loop, |
|
|
const uint8_t * |
stack |
|
) |
| |
|
staticprotected |
Initiate a task with the given functions and stack. When control is yield to the task the setup function is first called and then the loop function is repeatedly called.
- Parameters
-
[in] | setup | task function (may be NULL). |
[in] | loop | task function (may not be NULL). |
[in] | stack | top reference. |
Definition at line 135 of file Scheduler.cpp.
size_t SchedulerClass::stack |
( |
| ) |
|
|
static |
Return minimum remaining stack in bytes for running task. The value depends on executed function call depth and interrupt service routines during the execution (so far).
- Returns
- bytes
Definition at line 127 of file Scheduler.cpp.
bool SchedulerClass::start |
( |
func_t |
taskSetup, |
|
|
func_t |
taskLoop, |
|
|
size_t |
stackSize = DEFAULT_STACK_SIZE |
|
) |
| |
|
static |
Start a task with given functions and stack size. Should be called from main task (in setup). The functions are executed by the task. The taskSetup function (if provided) is run once. The taskLoop function is repeatedly called. The taskSetup may be omitted (NULL). Returns true if successful otherwise false.
- Parameters
-
[in] | taskSetup | function (may be NULL). |
[in] | taskLoop | function (may not be NULL). |
[in] | stackSize | in bytes. |
- Returns
- bool.
Definition at line 76 of file Scheduler.cpp.
static bool SchedulerClass::startLoop |
( |
func_t |
taskLoop, |
|
|
size_t |
stackSize = DEFAULT_STACK_SIZE |
|
) |
| |
|
inlinestatic |
Start a task with given taskLoop function and stack size. Should be called from main task (in setup). The taskLoop function is repeatedly called. Returns true if successful otherwise false.
- Parameters
-
[in] | taskLoop | function. |
[in] | stackSize | in bytes. |
- Returns
- bool.
Definition at line 65 of file Scheduler.h.
void SchedulerClass::yield |
( |
| ) |
|
|
static |
Context switch to next task in run queue.
Definition at line 117 of file Scheduler.cpp.
size_t SchedulerClass::s_top = SchedulerClass::DEFAULT_MAIN_STACK_SIZE |
|
staticprotected |
Task stack allocation top.
Definition at line 150 of file Scheduler.h.
The documentation for this class was generated from the following files: