firmware
IEM Firmware Documentation
Loading...
Searching...
No Matches
xEventGroupClearBitsFromISR
Collaboration diagram for xEventGroupClearBitsFromISR:

event_groups.h

#define xEventGroupClearBitsFromISR(xEventGroup, uxBitsToClear)
Definition event_groups.h:459
TickType_t EventBits_t
Definition event_groups.h:113
struct EventGroupDef_t * EventGroupHandle_t
Definition event_groups.h:103
long BaseType_t
Definition portmacro.h:59

A version of xEventGroupClearBits() that can be called from an interrupt.

Setting bits in an event group is not a deterministic operation because there are an unknown number of tasks that may be waiting for the bit or bits being set. FreeRTOS does not allow nondeterministic operations to be performed while interrupts are disabled, so protects event groups that are accessed from tasks by suspending the scheduler rather than disabling interrupts. As a result event groups cannot be accessed directly from an interrupt service routine. Therefore xEventGroupClearBitsFromISR() sends a message to the timer task to have the clear operation performed in the context of the timer task.

Note
If this function returns pdPASS then the timer task is ready to run and a portYIELD_FROM_ISR(pdTRUE) should be executed to perform the needed clear on the event group. This behavior is different from xEventGroupSetBitsFromISR because the parameter xHigherPriorityTaskWoken is not present.
Parameters
xEventGroupThe event group in which the bits are to be cleared.
uxBitsToClearA bitwise value that indicates the bit or bits to clear. For example, to clear bit 3 only, set uxBitsToClear to 0x08. To clear bit 3 and bit 0 set uxBitsToClear to 0x09.
Returns
If the request to execute the function was posted successfully then pdPASS is returned, otherwise pdFALSE is returned. pdFALSE will be returned if the timer service queue was full.

Example usage:

#define BIT_0 ( 1 << 0 )
#define BIT_4 ( 1 << 4 )
// An event group which it is assumed has already been created by a call to
// xEventGroupCreate().
EventGroupHandle_t xEventGroup;
void anInterruptHandler( void )
{
// Clear bit 0 and bit 4 in xEventGroup.
xEventGroup, // The event group being updated.
BIT_0 | BIT_4 ); // The bits being set.
if( xResult == pdPASS )
{
// The message was posted successfully.
}
}
#define portYIELD_FROM_ISR(x)
Definition portmacro.h:110
#define pdPASS
Definition projdefs.h:59
#define pdTRUE
Definition projdefs.h:53