FreeRTOS C++ Wrappers
1.6.0
C++ interface to FreeRTOS
|
#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 | |
virtual void | Run (uint32_t parameter)=0 |
void | CheckForSafeDelete () |
Static Private Member Functions | |
static void | TaskletAdapterFunction (void *ref, uint32_t parameter) |
Private Attributes | |
SemaphoreHandle_t | DtorLock |
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.
Definition at line 119 of file tasklet.hpp.
Tasklet::Tasklet | ( | ) |
Constructor
Definition at line 46 of file ctasklet.cpp.
|
virtual |
Destructor
Definition at line 62 of file ctasklet.cpp.
|
protected |
You must call this in your dtor, to synchronize between being called and being deleted.
Definition at line 67 of file ctasklet.cpp.
|
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. |
Definition at line 82 of file ctasklet.cpp.
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. |
Definition at line 104 of file ctasklet.cpp.
|
staticprivate |
Adapter function that allows you to write a class specific Run() function that interfaces with FreeRTOS. Look at the implementation of the constructors and this code to see how the interface between C and C++ is performed.
Definition at line 74 of file ctasklet.cpp.
|
private |
Protect against accidental deletion before we were executed.
Definition at line 209 of file tasklet.hpp.