Chapter 2. API Reference
Clear bits within an event group. This function cannot be called from an interrupt.
Example usage:
#define BIT_0 ( 1 << 0 )
#define BIT_4 ( 1 << 4 )
void aFunction( EventGroupHandle_t xEventGroup )
{
EventBits_t uxBits;
//
Clear bit
uxBits
=
xEventGroupClearBits(
if( ( uxBits
{
//
Both bit
// called.
}
else
if( ( uxBits
{
//
Bit
//
now be
}
else
if( ( uxBits
{
//
Bit
//
now be
}
else
{
//
Neither bit
}
}
Return The value of the event group before the specified bits were cleared.
Parameters
• xEventGroup: The event group in which the bits are to be cleared.
• uxBitsToClear: A bitwise value that indicates the bit or bits to clear in the event group. For
example, to clear bit 3 only, set uxBitsToClear to 0x08. To clear bit 3 and bit 0 set uxBitsToClear
to 0x09.
EventBits_t xEventGroupSetBits(EventGroupHandle_t
Set bits within an event group. This function cannot be called from an interrupt. xEventGroupSetBits-
FromISR() is a version that can be called from an interrupt.
Setting bits in an event group will automatically unblock tasks that are blocked waiting for the bits.
Example usage:
#define BIT_0 ( 1 << 0 )
#define BIT_4 ( 1 << 4 )
void aFunction( EventGroupHandle_t xEventGroup )
{
EventBits_t uxBits;
//
Set bit
uxBits
=
xEventGroupSetBits(
Espressif Systems
0
and
bit
4
in
xEventGroup.
xEventGroup,
BIT_0
|
&
( BIT_0
|
BIT_4 ) )
0
and
bit
4
were
Both will now be clear
&
BIT_0 )
!=
0
was
set
before xEventGroupClearBits() was
clear.
&
BIT_4 )
!=
4
was
set
before xEventGroupClearBits() was
clear.
0
nor bit
4
0
and
bit
4
in
xEventGroup.
xEventGroup,
BIT_0
|
BIT_4
Submit Document Feedback
//
The event group being
BIT_4
);//
The bits being
==
( BIT_0
|
BIT_4 ) )
set
before xEventGroupClearBits() was
(not
set).
0
)
0
)
were
set in
the first
xEventGroup, const
//
The event group being
);//
The bits being
934
updated.
cleared.
called.
It will
called.
It will
place.
EventBits_t
uxBitsToSet)
updated.
set.
(continues on next page)
Release v4.4
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?