mn::task_utils Class Reference
#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.
Member Function Documentation
◆ notify()
|
static |
Send task notification.
- Parameters
-
pTaskToNotify The task being notified. ulValue Data that can be sent with the notification. How the data is used depends on the value of the eAction parameter. eAction Specifies how the notification updates the task's notification value, if at all.
- Returns
- true If task notify and false If not
◆ notify_give()
|
static |
Send a task notification.
- Parameters
-
pTaskToNotify The task being notified.
- Returns
- true if give and else if not
◆ notify_take()
|
static |
Recive a task notification.
- Parameters
-
bClearCountOnExit if 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. xTicksToWait The 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 |
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
-
ulBitsToClearOnEntry Bits 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. ulBitsToClearOnExit If 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. pulNotificationValue Used 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. xTicksToWait The 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: