FreeRTOScpp
FreeRTOScpp::TaskS< stackDepth > Class Template Reference

Statically Created Task Wrapper. More...

#include <TaskCPP.h>

Inheritance diagram for FreeRTOScpp::TaskS< stackDepth >:
Collaboration diagram for FreeRTOScpp::TaskS< stackDepth >:

Public Member Functions

 TaskS (char const *name, void(*taskfun)(void *), TaskPriority priority_, void *myParm=0)
 Constructor. More...
 
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...
 

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...
 

Detailed Description

template<uint32_t stackDepth>
class FreeRTOScpp::TaskS< stackDepth >

Statically Created Task Wrapper.

Create the specified task with a provided task function.

Template Parameters
stackDepthSize of the stack to give to the task

If the Task object is destroyed, the class will be deleted (if deletion has been enabled)

Constructor & Destructor Documentation

◆ TaskS()

template<uint32_t stackDepth>
FreeRTOScpp::TaskS< stackDepth >::TaskS ( char const *  name,
void(*)(void *)  taskfun,
TaskPriority  priority_,
void *  myParm = 0 
)
inline

Constructor.

Parameters
nameThe name of the task.
taskfunThe function implementing the task, should have type void (*taskfun)(void *)
priority_The priority of the task. Use the TaskPriority enum values or a related value converted to a TaskPriority
myParmthe parameter passed to taskFun. Defaults to NULL.

Upon construction the task will be created.

References FreeRTOScpp::TaskBase::TaskBase(), and FreeRTOScpp::TaskBase::taskHandle.

Here is the call graph for this function:

Member Function Documentation

◆ delay() [1/2]

static void FreeRTOScpp::TaskBase::delay ( TickType_t  time)
inlinestaticinherited

Delay for a period of time.

Parameters
timethe 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

◆ delay() [2/2]

static void FreeRTOScpp::TaskBase::delay ( Time_ms  ms)
inlinestaticinherited

Delay for a period of time, specified in milliseconds.

Parameters
msThe 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.

Here is the call graph for this function:

◆ getTaskHandle()

TaskHandle_t FreeRTOScpp::TaskBase::getTaskHandle ( ) const
inlineinherited

Get Task Handle.

Returns
the task handle.

References FreeRTOScpp::TaskBase::taskHandle.

◆ give()

bool FreeRTOScpp::TaskBase::give ( )
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().

Here is the caller graph for this function:

◆ give_ISR()

void FreeRTOScpp::TaskBase::give_ISR ( portBASE_TYPE &  waswoken)
inlineinherited

◆ notify()

bool FreeRTOScpp::TaskBase::notify ( uint32_t  value,
eNotifyAction  act 
)
inlineinherited

Notify a Task.

Generic Task Notification operation

References FreeRTOScpp::TaskBase::taskHandle.

◆ notify_ISR()

bool FreeRTOScpp::TaskBase::notify_ISR ( uint32_t  value,
eNotifyAction  act,
portBASE_TYPE &  waswoken 
)
inlineinherited

◆ notify_query()

bool FreeRTOScpp::TaskBase::notify_query ( uint32_t  value,
eNotifyAction  act,
uint32_t &  old 
)
inlineinherited

◆ notify_query_ISR()

bool FreeRTOScpp::TaskBase::notify_query_ISR ( uint32_t  value,
eNotifyAction  act,
uint32_t &  old,
portBASE_TYPE &  waswoken 
)
inlineinherited

◆ priority()

void FreeRTOScpp::TaskBase::priority ( TaskPriority  priority_)
inlineinherited

Set Task priority.

Only available if INCLUDE_vTaskPrioritySet == 1

Parameters
priority_The TaskPriority to give the Task.

References FreeRTOScpp::TaskBase::taskHandle.

Referenced by FreeRTOScpp::TaskBase::delay().

Here is the caller graph for this function:

◆ resume()

void FreeRTOScpp::TaskBase::resume ( )
inlineinherited

Resume the Task.

Only available if INCLUDE_vTaskSuspend == 1

References FreeRTOScpp::TaskBase::taskHandle.

◆ suspend()

void FreeRTOScpp::TaskBase::suspend ( )
inlineinherited

Suspend the Task.

Only available if INCLUDE_vTaskSuspend == 1

References FreeRTOScpp::TaskBase::taskHandle.

◆ take() [1/2]

static uint32_t FreeRTOScpp::TaskBase::take ( bool  clear = true,
TickType_t  ticks = portMAX_DELAY 
)
inlinestaticinherited

Wait for a task Give notification.

Specialized wait() designed to work with the give()/give_ISR() notifications.

Parameters
clearFlag 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.
ticksThe time to wait for the semaphore.
Returns
Returns the notification word (prior to being adjusted for the take() ), Will be zero if the take() timed out.

Referenced by taskcpp_task_thunk().

Here is the caller graph for this function:

◆ take() [2/2]

static uint32_t FreeRTOScpp::TaskBase::take ( bool  clear,
Time_ms  ticks 
)
inlinestaticinherited

Wait for a task Give notification.

Specialized wait() designed to work with the give()/give_ISR() notifications.

Parameters
clearFlag 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.
ticksThe time to wait for the semaphore.
Returns
Returns the notification word (prior to being adjusted for the take() ), Will be zero if the take() timed out.

References FreeRTOScpp::ms2ticks().

Here is the call graph for this function:

◆ wait() [1/2]

static uint32_t FreeRTOScpp::TaskBase::wait ( uint32_t  clearEnter,
uint32_t  clearExit = 0xFFFFFFFF,
uint32_t *  value = nullptr,
TickType_t  ticks = portMAX_DELAY 
)
inlinestaticinherited

Wait for task notification.

◆ wait() [2/2]

static uint32_t FreeRTOScpp::TaskBase::wait ( uint32_t  clearEnter,
uint32_t  clearExit,
uint32_t *  value,
Time_ms  ms 
)
inlinestaticinherited

References FreeRTOScpp::ms2ticks().

Here is the call graph for this function:

◆ waitIndex() [1/2]

static uint32_t FreeRTOScpp::TaskBase::waitIndex ( UBaseType_t  idx,
uint32_t  clearEnter,
uint32_t  clearExit = 0xFFFFFFFF,
uint32_t *  value = nullptr,
TickType_t  ticks = portMAX_DELAY 
)
inlinestaticinherited

◆ waitIndex() [2/2]

static uint32_t FreeRTOScpp::TaskBase::waitIndex ( UBaseType_t  idx,
uint32_t  clearEnter,
uint32_t  clearExit,
uint32_t *  value,
Time_ms  ms 
)
inlinestaticinherited

References FreeRTOScpp::ms2ticks().

Here is the call graph for this function:

Member Data Documentation

◆ taskHandle


The documentation for this class was generated from the following file: