xEventGroupClearBitsFromISR()
[事件组 API]
event_groups.h
BaseType_t xEventGroupClearBitsFromISR(
EventGroupHandle_t xEventGroup,
const EventBits_t uxBitsToClear );
可以从中断调用的 xEventGroupClearBits() 版本
。 清除操作被延迟为 RTOS
守护进程任务,也称为定时器服务任务。 守护进程任务的
优先级由
configTIMER_TASK_PRIORITY
FreeRTOSConfig.h 中的设置来设定。
要使 xEventGroupClearBitsFromISR() 函数可用,RTOS 源文件 FreeRTOS/source/event_groups.c 必须
包含在构建中。
-
参数:
-
xEventGroup
|
要在其中清除位的事件组。 此事件组
必须已通过
调用 xEventGroupCreate() 事先创建。
|
uxBitsToClear
|
表示要在事件组中清除一个或多个位的
按位值。 例如,将 uxBitsToClear 设置为 0x08
以仅清除位 3。 将 uxBitsToClear 设置为 0x09 以清除位 3
和位 0。
|
-
返回:
-
如果操作已成功延迟为 RTOS 守护进程任务,则返回 pdPASS。 否则返回 pdFALSE。 只有当定时器命令队列已满时,才会返回 pdFALSE。
用法示例:
#define BIT_0 ( 1 << 0 )
#define BIT_4 ( 1 << 4 )
/* This code assumes the event group referenced by the
xEventGroup variable has already been created using a call to
xEventGroupCreate(). */
void anInterruptHandler( void )
{
BaseType_t xSuccess;
/* Clear bit 0 and bit 4 in xEventGroup. */
xSuccess = xEventGroupClearBitsFromISR(
xEventGroup, /* The event group being updated. */
BIT_0 | BIT_4 );/* The bits being cleared. */
if( xSuccess == pdPASS )
{
/* The command was sent to the daemon task. */
}
else
{
/* The clear bits command was not sent to the daemon task. */
}
}
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.