Chapter 2. API Reference
within the array. xTaskNotifyStateClear() is the original API function, and remains backward compatible
by always operating on the notification value at index 0 within the array. Calling xTaskNotifyStateClear() is
equivalent to calling xTaskNotifyStateClearIndexed() with the uxIndexToNotify parameter set to 0.
Return pdTRUE if the task's notification state was set to eNotWaitingNotification, otherwise pdFALSE.
Parameters
• xTask: The handle of the RTOS task that will have a notification state cleared. Set xTask to NULL
to clear a notification state in the calling task. To obtain a task's handle create the task using
xTaskCreate() and make use of the pxCreatedTask parameter, or create the task using xTaskCreat-
eStatic() and store the returned value, or use the task's name in a call to xTaskGetHandle().
• uxIndexToClear: The index within the target task's array of notification values to act upon.
For example, setting uxIndexToClear to 1 will clear the state of the notification at index 1 within
the array. uxIndexToClear must be less than configTASK_NOTIFICATION_ARRAY_ENTRIES.
ulTaskNotifyStateClear() does not have this parameter and always acts on the notification at index
0.
uint32_t
ulTaskGenericNotifyValueClear(TaskHandle_t
See
https://www.FreeRTOS.org/RTOS-task-notifications.html
configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for these functions to be available.
Each task has a private array of "notification values"(or 'notifications'), each of which is a 32-bit un-
signed integer (uint32_t). The constant configTASK_NOTIFICATION_ARRAY_ENTRIES sets the number
of indexes in the array, and (for backward compatibility) defaults to 1 if left undefined. Prior to FreeRTOS
V10.4.0 there was only one notification value per task.
ulTaskNotifyValueClearIndexed() clears the bits specified by the ulBitsToClear bit mask in the notification
value at array index uxIndexToClear of the task referenced by xTask.
Backward compatibility information: Prior to FreeRTOS V10.4.0 each task had a single "notification value"
, and all task notification API functions operated on that value. Replacing the single notification value with
an array of notification values necessitated a new set of API functions that could address specific notifications
within the array. ulTaskNotifyValueClear() is the original API function, and remains backward compatible
by always operating on the notification value at index 0 within the array. Calling ulTaskNotifyValueClear() is
equivalent to calling ulTaskNotifyValueClearIndexed() with the uxIndexToClear parameter set to 0.
Return The value of the target task's notification value before the bits specified by ulBitsToClear were
cleared.
Parameters
• xTask: The handle of the RTOS task that will have bits in one of its notification values cleared.
Set xTask to NULL to clear bits in a notification value of the calling task. To obtain a task' s handle
create the task using xTaskCreate() and make use of the pxCreatedTask parameter, or create the
task using xTaskCreateStatic() and store the returned value, or use the task's name in a call to
xTaskGetHandle().
• uxIndexToClear: The index within the target task' s array of notification values in which to clear
the bits. uxIndexToClear must be less than configTASK_NOTIFICATION_ARRAY_ENTRIES.
ulTaskNotifyValueClear() does not have this parameter and always clears bits in the notification
value at index 0.
• ulBitsToClear: Bit mask of the bits to clear in the notification value of xTask. Set a bit to
1 to clear the corresponding bits in the task's notification value. Set ulBitsToClear to 0xffffffff
(UINT_MAX on 32-bit architectures) to clear the notification value to 0. Set ulBitsToClear to 0 to
query the task's notification value without clearing any bits.
void vTaskSetTimeOutState(TimeOut_t *const pxTimeOut)
BaseType_t xTaskCheckForTimeOut(TimeOut_t *const pxTimeOut, TickType_t *const pxTick-
Determines if pxTicksToWait ticks has passed since a time was captured using a call to vTaskSetTimeOut-
State(). The captured time includes the tick count and the number of times the tick count has overflowed.
Example Usage:
Espressif Systems
uint32_t ulBitsToClear)
sToWait)
878
Submit Document Feedback
xTask, UBaseType_t uxIndexToClear,
for details.
Release v4.4
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?
Questions and answers