FreeRTOS 事件标志组

信号量同步只能与单个的事件或任务进行同步。事件标志组与多个事件或任务进行同步
事件位用来表明某个事件是否发生,事件组是一组事件位
FreeRTOS 事件标志组_第1张图片

//动态方法创建事件标志组
EventGroupHandle_t xEventGroupCreate( void )

//设置事件位
EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet )

//事件组等待
EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToWaitFor, 
const BaseType_t xClearOnExit, const BaseType_t xWaitForAllBits, TickType_t xTicksToWait )

//事件查询
#define xEventGroupGetBits( xEventGroup ) xEventGroupClearBits( xEventGroup, 0 )
EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear )

你可能感兴趣的:(FreeRTOS)