Task notifications
Queues are an excellent workhorse of an RTOS because of their flexibility. Sometimes, all of this flexibility isn’t needed and we’d prefer a more lightweight alternative for tasks to communicate with each other. FreeRTOS provides this with its task notifications feature.
A task notification has two main components: the notification itself, and a 32-bit value. A task can send a notification to another task. Conversely, a task can read a notification that has been sent to it. Each task has a notification state, which can be pending or not-pending. Each task also has a notification value, which is a 32-bit unsigned integer. The notification value is stored in the task’s Task Control Block (TCB). The TCB is defined in Middleware\Third_Party\FreeRTOS\Source\tasks.c
.
When a notification is sent to a task, its notification state is set to pending. When a task reads its notification value, its notification state is set to not-pending. When a...