4 Event Groups Flashcards

1
Q

What is an event group?

A

An event group is a group of bits or flags. An event group allows a task to be in a blocked state until an event or combination of event occur.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why are event flags used?

A

An event flag is used to indicate if an event has occurred or not.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How many event flags can an event group store?

A

24, bits 0 to 23.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the difference between an event group and semaphore when unblocking tasks?

A

Event groups can unblock multiple tasks, a semaphore can only unblock a single task.
A semaphore allows a task to wait in a blocked state until a single event occurs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What advantages does an event group have over a semaphore?

A

Can synchronise multiple task,
It can unblock multiple tasks,
Allow a task to remain in a blocked state until a combination of events occur,
An event group uses less RAM then multiple binary semaphores.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you create an event group?

A

Declare an event group variable:
EventGroupHandle_t SW_EventGroup = NULL;
Create the event group in main()
SW_EventGroup = xEventGroupCreate();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you set an event group bit(s)?

A

define BIT0 (1«0)

xEventGroupSetBits(SW_EventGroup, BIT0)

For Multiple Bits
xEventGroupSetBits(SW_EventGroup, BIT0 | BIT1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How to wait on event group bit(s)?

A

xEventGroupWaitBits(SW_EventGroup, BIT0, pdTrue, pdFalse, portMAX_DELAY)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly