当前位置:网站首页>FreeRTOS task notification review

FreeRTOS task notification review

2022-06-09 08:58:00 Lee1989 Qi

One 、 Basic concepts

  • effect : Reduce RAM Consume , Do not create semaphores separately , queue , The task notification can be used automatically after the task is created by the communication mechanism such as counting quantity .
  • Default FreeRTOSConfig.h
    configUSE_TASK_NOTIFICATIONS Set to 1, Its FreeRTOS The default is for 1 Of , So task notification is enabled by default .
  • FreeRTOS from V8.2.0 The version starts to provide task notification , Each task has a 32 Notification value of bit , in the majority of cases , Task notifications can replace binary semaphores 、 Count the semaphore 、 Event group , It can also be replaced The length is 1 Queues ( You can save a
    32 Bit integer or pointer value ).
  • according to FreeRTOS Official statement , Use task notification rather than through semaphores, etc ICP The task of unblocking the communication mode should be fast 45%, And more economical RAM Memory space

shortcoming :

  • Only one task can receive notification messages , Because you must specify a task to receive notifications .
  • Only tasks waiting for notification can be blocked , The task of sending notifications , In any case, it will not enter the blocking state due to transmission failure .

Two 、 experiment

The principle is the same as that of the previous event group 、 Semaphore 、 The message queue communication mechanism is similar , Calling function is different .

原网站

版权声明
本文为[Lee1989 Qi]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/160/202206090845276613.html