FreeRTOScpp
|
Make a class based task. More...
#include <TaskCPP.h>
Public Member Functions | |
TaskClassS (char const *name, TaskPriority priority_, unsigned portSHORT stackDepth_=0) | |
Constructor. More... | |
virtual | ~TaskClassS () |
TaskHandle_t | getTaskHandle () const |
Get Task Handle. More... | |
bool | give () |
Notify a Task as a semaphore. More... | |
void | give_ISR (portBASE_TYPE &waswoken) |
bool | notify (uint32_t value, eNotifyAction act) |
Notify a Task. More... | |
bool | notify_ISR (uint32_t value, eNotifyAction act, portBASE_TYPE &waswoken) |
bool | notify_query (uint32_t value, eNotifyAction act, uint32_t &old) |
bool | notify_query_ISR (uint32_t value, eNotifyAction act, uint32_t &old, portBASE_TYPE &waswoken) |
void | priority (TaskPriority priority_) |
Set Task priority. More... | |
void | resume () |
Resume the Task. More... | |
void | suspend () |
Suspend the Task. More... | |
void | task () override=0 |
task function. More... | |
Static Public Member Functions | |
static void | delay (TickType_t time) |
Delay for a period of time. More... | |
static void | delay (Time_ms ms) |
Delay for a period of time, specified in milliseconds. More... | |
static uint32_t | take (bool clear=true, TickType_t ticks=portMAX_DELAY) |
Wait for a task Give notification. More... | |
static uint32_t | take (bool clear, Time_ms ticks) |
Wait for a task Give notification. More... | |
static uint32_t | wait (uint32_t clearEnter, uint32_t clearExit=0xFFFFFFFF, uint32_t *value=nullptr, TickType_t ticks=portMAX_DELAY) |
Wait for task notification. More... | |
static uint32_t | wait (uint32_t clearEnter, uint32_t clearExit, uint32_t *value, Time_ms ms) |
static uint32_t | waitIndex (UBaseType_t idx, uint32_t clearEnter, uint32_t clearExit=0xFFFFFFFF, uint32_t *value=nullptr, TickType_t ticks=portMAX_DELAY) |
static uint32_t | waitIndex (UBaseType_t idx, uint32_t clearEnter, uint32_t clearExit, uint32_t *value, Time_ms ms) |
Protected Attributes | |
TaskHandle_t | taskHandle |
Handle for the task we are managing. More... | |
Make a class based task.
Derive from TaskClass and the 'task()' member function will get called as the task based on the class.
stackDepth | Size of the stack to give to the task |
If task() returns the task will be deleted if deletion has been enabled.
|
inline |
Constructor.
name | The name of the task. |
priority_ | The priority of the task. Use the TaskPriority enum values or a related value converted to a TaskPriority |
stackDepth_ | How many words of stack to allocate to the task. Only used if the template parameter stackDepth is 0 |
API CHANGE! If at constrtuction time, the scheduler is not running, we can release the task. If the scheduler is running, because the task may startup before we finish constructing the task, the most derived constructor will need to give the task.
Change from previous API to support SMP mode where the previous trick won't work anymore.
References FreeRTOScpp::TaskBase::give().
|
inlinevirtual |
References FreeRTOScpp::TaskBase::give(), and taskcpp_task_thunk().
|
inlinestaticinherited |
Delay for a period of time.
time | the number of ticks to delay |
This is a static member function as it affects the CALLING task, not the task it might be called on
|
inlinestaticinherited |
Delay for a period of time, specified in milliseconds.
ms | The number of milliseconds to delay |
This is a static member function as it affects the CALLING task, not the task it might be called on
References FreeRTOScpp::ms2ticks(), FreeRTOScpp::TaskBase::priority(), and FreeRTOScpp::TaskBase::taskHandle.
|
inlineinherited |
|
inlineinherited |
Notify a Task as a semaphore.
Sends a notification to a task using a semaphore based protocol. Generally the task should we using the take() function to receive the notification.
References FreeRTOScpp::TaskBase::taskHandle.
Referenced by FreeRTOScpp::TaskClassS< stackDepth >::TaskClassS(), and FreeRTOScpp::TaskClassS< stackDepth >::~TaskClassS().
|
inlineinherited |
References FreeRTOScpp::TaskBase::taskHandle.
|
inlineinherited |
|
inlineinherited |
References FreeRTOScpp::TaskBase::taskHandle.
|
inlineinherited |
References FreeRTOScpp::TaskBase::taskHandle.
|
inlineinherited |
References FreeRTOScpp::TaskBase::taskHandle.
|
inlineinherited |
Set Task priority.
Only available if INCLUDE_vTaskPrioritySet == 1
priority_ | The TaskPriority to give the Task. |
References FreeRTOScpp::TaskBase::taskHandle.
Referenced by FreeRTOScpp::TaskBase::delay().
|
inlineinherited |
Resume the Task.
Only available if INCLUDE_vTaskSuspend == 1
References FreeRTOScpp::TaskBase::taskHandle.
|
inlineinherited |
Suspend the Task.
Only available if INCLUDE_vTaskSuspend == 1
References FreeRTOScpp::TaskBase::taskHandle.
|
inlinestaticinherited |
Wait for a task Give notification.
Specialized wait() designed to work with the give()/give_ISR() notifications.
clear | Flag to indicate if the action on succesful take is to clear (True) or decrement (False) the notification value. Effectively decides between a binary (True) or counting (False) semaphore behavior. |
ticks | The time to wait for the semaphore. |
Referenced by taskcpp_task_thunk().
|
inlinestaticinherited |
Wait for a task Give notification.
Specialized wait() designed to work with the give()/give_ISR() notifications.
clear | Flag to indicate if the action on successful take is to clear (True) or decrement (False) the notification value. Effectively decides between a binary (True) or counting (False) semaphore behavior. |
ticks | The time to wait for the semaphore. |
References FreeRTOScpp::ms2ticks().
|
overridepure virtual |
|
inlinestaticinherited |
Wait for task notification.
|
inlinestaticinherited |
|
inlinestaticinherited |
|
inlinestaticinherited |
|
protectedinherited |
Handle for the task we are managing.
Referenced by FreeRTOScpp::TaskBase::delay(), FreeRTOScpp::TaskBase::getTaskHandle(), FreeRTOScpp::TaskBase::give(), FreeRTOScpp::TaskBase::give_ISR(), FreeRTOScpp::TaskBase::notify(), FreeRTOScpp::TaskBase::notify_ISR(), FreeRTOScpp::TaskBase::notify_query(), FreeRTOScpp::TaskBase::notify_query_ISR(), FreeRTOScpp::TaskBase::priority(), FreeRTOScpp::TaskBase::resume(), FreeRTOScpp::TaskBase::suspend(), FreeRTOScpp::TaskS< stackDepth >::TaskS(), and FreeRTOScpp::TaskBase::~TaskBase().