Public Member Functions |
Protected Member Functions |
Static Protected Member Functions |
Protected Attributes |
List of all members
mn::basic_tasklet Class Referenceabstract
#include <mn_tasklet.hpp>
Collaboration diagram for mn::basic_tasklet:
Public Member Functions | |
basic_tasklet () | |
virtual int | schedule (uint32_t parameter, unsigned int timeout=MN_THREAD_CONFIG_TIMEOUT_COROUTINE_DEFAULT) |
virtual int | destroy () |
Protected Member Functions | |
virtual bool | on_tasklet (uint32_t arg)=0 |
Static Protected Member Functions | |
static void | runtasklet (void *parm, uint32_t parameter) |
Protected Attributes | |
counting_semaphore_t | m_ssLock |
Detailed Description
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 tasklet should be derived from the basic_tasklet class. Then implement the virtual on_tasklet function.
Constructor & Destructor Documentation
◆ basic_tasklet()
mn::basic_tasklet::basic_tasklet | ( | ) |
Member Function Documentation
◆ destroy()
|
virtual |
Destroy the Tasklet
- Returns
- ERR_COROUTINE_OK Destroyed without any errors
◆ on_tasklet()
|
protectedpure virtual |
Implementation of your actual tasklet code. You must override this function.
- Parameters
-
parameter Value passed to you from the create() methods.
- Returns
- false to end the on_tasklet and true when run
◆ runtasklet()
|
staticprotected |
Adapter function that allows you to write a class specific on_tasklet() function that interfaces with FreeRTOS.
◆ schedule()
|
virtual |
schedule this Tasklet to run.
- Parameters
-
parameter Value passed to your on_tasklet method. CmdTimeout How long to wait to send this command to the timer daemon.
- Returns
- ERR_COROUTINE_OK This command will be sent to the timer daemon, ERR_COROUTINE_CANSHEDULE It will not (i.e. timeout) and ERR_COROUTINE_CANTINITLOCKT The Locking Object can't create - tasklet not run
Member Data Documentation
◆ m_ssLock
|
protected |
Protect against accidental deletion before we were executed.
The documentation for this class was generated from the following files: