#include <mn_task_utils.hpp>

+ Inheritance diagram for mn::task_utils:
+ Collaboration diagram for mn::task_utils:

Public Types

enum  action {
  no_action = eNoAction , set_bits = eSetBits , increment = eIncrement , set_value_overwrite = eSetValueWithOverwrite ,
  set_value = eSetValueWithoutOverwrite
}
 

Static Public Member Functions

static bool notify (basic_task *pTaskToNotify, uint32_t ulValue, task_utils::action eAction)
 
static uint32_t notify_take (bool bClearCountOnExit, TickType_t xTicksToWait)
 
static bool notify_give (basic_task *pTaskToNotify)
 
static bool notify_wait (uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue, TickType_t xTicksToWait)
 

Detailed Description

FreeRTOS wrapper for notify and broadcast a task

Member Enumeration Documentation

◆ action

Actions that can be performed when task_utils::notify() is called.

Enumerator
no_action 

Notify the task without updating its notify value.

set_bits 

Set bits in the task's notification value.

increment 

Increment the task's notification value.

set_value_overwrite 

Set the task's notification value to a specific value even if the previous value has not yet been read by the task.

set_value 

Set the task's notification value if the previous value has been read by the task.

Member Function Documentation

◆ notify()

static bool mn::task_utils::notify ( basic_task pTaskToNotify,
uint32_t  ulValue,
task_utils::action  eAction 
)
static

Send task notification.

Parameters
pTaskToNotifyThe task being notified.
ulValueData that can be sent with the notification. How the data is used depends on the value of the eAction parameter.
eActionSpecifies how the notification updates the task's notification value, if at all.
Returns
true If task notify and false If not

◆ notify_give()

static bool mn::task_utils::notify_give ( basic_task pTaskToNotify)
static

Send a task notification.

Parameters
pTaskToNotifyThe task being notified.
Returns
true if give and else if not

◆ notify_take()

static uint32_t mn::task_utils::notify_take ( bool  bClearCountOnExit,
TickType_t  xTicksToWait 
)
static

Recive a task notification.

Parameters
bClearCountOnExitif is false then the task's notification value is decremented when the function exits. If true then the task's notification value is cleared to zero when the function exits.
xTicksToWaitThe maximum amount of time that the task should wait in the Blocked state for the task's notification value to be greater than zero, should the count not already be greater than zero when notify_take() was called. The task will not consume any processing time while it is in the Blocked state. This is specified in kernel ticks, the function ms_to_ticks( value_in_ms ) can be used to convert a time specified in milliseconds to a time specified in ticks.
Returns
The task's notification count before it is either cleared to zero or decremented

◆ notify_wait()

static bool mn::task_utils::notify_wait ( uint32_t  ulBitsToClearOnEntry,
uint32_t  ulBitsToClearOnExit,
uint32_t *  pulNotificationValue,
TickType_t  xTicksToWait 
)
static

Wait for task notification

A task can use notify_wait() to block to wait for its notification value to have a non-zero value. The task does not consume any CPU time while it is in the Blocked state.

Parameters
ulBitsToClearOnEntryBits that are set in ulBitsToClearOnEntry value will be cleared in the calling task's notification value before the task checks to see if any notifications are pending, and optionally blocks if no notifications are pending.
ulBitsToClearOnExitIf a notification is pending or received before the calling task exits the notify_wait() function then the task's notification value is passed out using the pulNotificationValue parameter.
pulNotificationValueUsed to pass the task's notification value out of the function. Note the value passed out will not be effected by the clearing of any bits caused by ulBitsToClearOnExit being non-zero.
xTicksToWaitThe maximum amount of time that the task should wait in the Blocked state for a notification to be received, should a notification not already be pending when notify_wait() was called.
Returns
If a notification was received then true is returned. Otherwise false is returned.

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