Static void prvTask2( void *pvParameters ) * prvTask2() uses the original version of the API (without the UlTaskNotifyTakeIndexed( 0, pdTRUE, portMAX_DELAY ) * Block to wait for prvTask2() to notify this task. * Send notification to prvTask2(), bringing it out of the Static void prvTask1( void *pvParameters ) * prvTask1() uses the 'indexed' version of the API. XTaskCreate( prvTask2, "Task2", 200, NULL, tskIDLE_PRIORITY, &xTask2 ) XTaskCreate( prvTask1, "Task1", 200, NULL, tskIDLE_PRIORITY, &xTask1 ) * Create two tasks that send notifications back and forth to each other, Static TaskHandle_t xTask1 = NULL, xTask2 = NULL * Handles for the tasks create by main(). * Prototypes of the two tasks created by main(). XTaskNotifyGiveIndexed() is a macro that calls xTaskNotifyIndexed() with theĮAction parameter set to eIncrement, so all calls returning pdPASS. XTaskNotifyGive() does not have this parameter and always sends notifications to index 0. UxIndexToNotify must be less than configTASK_NOTIFICATION_ARRAY_ENTRIES. Notification values to which the notification is to be sent. The index within the target task's array of The handle of the currently executing RTOS task is returned by PxCreatedTask parameter, or create the task usingĪnd store the returned value, or use the task's name in a To obtain a task's handle create the task using The handle of the RTOS task being notified, and having its XTaskNotifyGiveIndexed() with the uxIndexToNotify parameter set to 0. Calling xTaskNotifyGive() is equivalent to calling xTaskNotifyGive() is the original API function, and remains backwardĬompatible by always operating on the notification value at index 0 in theĪrray. New set of API functions that could address specific notifications within theĪrray. Single notification value with an array of notification values necessitated a Prior to FreeRTOS V10.4.0 each task had a single "notification value", andĪll task notification API functions operated on that value. Must set to 1 in FreeRTOSConfig.h (or be left undefined) for these macros to be available.ĬonfigTASK_NOTIFICATION_ARRAY_ENTRIES sets the number of indexes in XTaskNotifyGive() must not be called from an interrupt service routine. Note: Each notification within the array operates independently – a task can only block on one notification within the array at a time and will not be unblocked by a notification sent to any other array index. When a task notification value is being used as a binary or counting semaphoreĮquivalent then the task being notified should wait for the notificationįunction rather than the xTaskNotifyWait() XTaskNotifyGive() and xTaskNotifyGiveIndexed() are equivalent macros - the only differenceīeing xTaskNotifyGiveIndexed() can operate on any task notification within theĪrray and xTaskNotifyGive() always operates on the task notification at array index 0. Is the equivalent that uses one of the receiving RTOS task’s notification values in place of a semaphore. XTaskNotifyGive() is a macro intended for use when a task notificationĪnd faster binary or counting semaphore alternative.įreeRTOS semaphores are given using the xSemaphoreGive() API function, xTaskNotifyGive() More bits in one of the receiving task's notification values. #TASKR NOTIFY TASKS UPDATE#Optionally update one of the receiving task’s notification values in a number of different ways.įor example, a notification may overwrite one of the receiving task's notification values, or just set one or A direct to task notification is an event sentĭirectly to a task that can unblock the receiving task, and Kernel > API Reference > Direct To Task Notifications > xTaskNotifyGive() xTaskNotifyGive / xTaskNotifyGiveIndexedīaseType_t xTaskNotifyGive( TaskHandle_t xTaskToNotify ) īaseType_t xTaskNotifyGiveIndexed( TaskHandle_t xTaskToNotify,Įach task has an array of 'task notifications' (or just 'notifications'), each
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |