FreeRTOS Addons
|
#include <tasklet.hpp>
Public Member Functions | |
Tasklet () | |
virtual | ~Tasklet () |
bool | Schedule (uint32_t parameter, TickType_t CmdTimeout=portMAX_DELAY) |
bool | ScheduleFromISR (uint32_t parameter, BaseType_t *pxHigherPriorityTaskWoken) |
Protected Member Functions | |
void | CheckForSafeDelete () |
virtual void | Run (uint32_t parameter)=0 |
A FreeRTOS wrapper for its concept of a Pended Function. In Linux, one permutation of this would be a Tasklet, or bottom half processing from an ISR.
This is an abstract base class. To use this, you need to subclass it. All of your Tasklets should be derived from the Tasklet class. Then implement the virtual Run function. This is a similar design to Java threading.
Tasklet::Tasklet | ( | ) |
Constructor
|
virtual |
Destructor
|
protected |
You must call this in your dtor, to synchronize between being called and being deleted.
|
protectedpure virtual |
Implementation of your actual tasklet code. You must override this function.
parameter | Value passed to you from the Schedule() methods. |
bool Tasklet::Schedule | ( | uint32_t | parameter, |
TickType_t | CmdTimeout = portMAX_DELAY |
||
) |
Schedule this Tasklet to run.
parameter | Value passed to your Run method. |
CmdTimeout | How long to wait to send this command to the timer daemon. |
bool Tasklet::ScheduleFromISR | ( | uint32_t | parameter, |
BaseType_t * | pxHigherPriorityTaskWoken | ||
) |
Schedule this Tasklet to run from ISR context. This allows FreeRTOS ISRs to defer processing from the ISR into a task context.
parameter | Value passed to your Run method. |
pxHigherPriorityTaskWoken | Did this operation result in a rescheduling event. |