1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
34
35
36
37
38
39
40
41
42
46
47
48
51
52
57
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
108
109
110
111
112
113
114
115
116
117
118
119
125
126
127
128
129
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
176
177
178
179
180
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
204
205
206
207
208
209
210
211
212
213
214
215
216
217
219
220
221
222
223
224
225
226
227
228
229
232
233
234
238
239
240
247
248
249
250
251
252
253
257
261
262
266
267
268
269
270
271
272
288
289
290
291
292
296
297
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
320
321
322
323
324
327
328
329
330
331
332
333
334
335
336
337
338
340
341
342
343
344
348
352
353
360
361
362
366
370
374
375
379
383
384
387
388
389
392
393
394
395
396
397
398
399
400
401
405
409
410
414
415
416
417
418
419
420
421
422
423
425
436
440
441
442
443
444
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
468
469
470
471
472
473
474
475
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
567
572
576
577
578
579
580
584
588
589
594
595
596
597
600
601
602
603
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
629
630
631
636
637
649
650
651
652
653
654
655
657
661
662
663
665
669
670
671
672
673
674
675
688
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
732
736
737
738
739
740
741
742
743
744
751
752
753
/* ... */
#include <stdlib.h>
/* ... */
#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
#include "FreeRTOS.h"
#include "task.h"
#include "timers.h"
#include "event_groups.h"
/* ... */
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
/* ... */
#if configUSE_16_BIT_TICKS == 1
#define eventCLEAR_EVENTS_ON_EXIT_BIT 0x0100U
#define eventUNBLOCKED_DUE_TO_BIT_SET 0x0200U
#define eventWAIT_FOR_ALL_BITS 0x0400U
#define eventEVENT_BITS_CONTROL_BYTES 0xff00U
/* ... */#else
#define eventCLEAR_EVENTS_ON_EXIT_BIT 0x01000000UL
#define eventUNBLOCKED_DUE_TO_BIT_SET 0x02000000UL
#define eventWAIT_FOR_ALL_BITS 0x04000000UL
#define eventEVENT_BITS_CONTROL_BYTES 0xff000000UL
/* ... */#endif
typedef struct EventGroupDef_t
{
EventBits_t uxEventBits;
List_t xTasksWaitingForBits;
#if( configUSE_TRACE_FACILITY == 1 )
UBaseType_t uxEventGroupNumber;
#endif
#if( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
uint8_t ucStaticallyAllocated;
#endif
...} EventGroup_t;
/* ... */
static BaseType_t prvTestWaitCondition( const EventBits_t uxCurrentEventBits, const EventBits_t uxBitsToWaitFor, const BaseType_t xWaitForAllBits ) PRIVILEGED_FUNCTION;
#if( configSUPPORT_STATIC_ALLOCATION == 1 )
EventGroupHandle_t xEventGroupCreateStatic( StaticEventGroup_t *pxEventGroupBuffer )
{
EventGroup_t *pxEventBits;
configASSERT( pxEventGroupBuffer );
#if( configASSERT_DEFINED == 1 )
{
/* ... */
volatile size_t xSize = sizeof( StaticEventGroup_t );
configASSERT( xSize == sizeof( EventGroup_t ) );
...} /* ... */
#endif
pxEventBits = ( EventGroup_t * ) pxEventGroupBuffer;
if( pxEventBits != NULL )
{
pxEventBits->uxEventBits = 0;
vListInitialise( &( pxEventBits->xTasksWaitingForBits ) );
#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
{
/* ... */
pxEventBits->ucStaticallyAllocated = pdTRUE;
...}/* ... */
#endif
traceEVENT_GROUP_CREATE( pxEventBits );
}if (pxEventBits != NULL) { ... }
else
{
/* ... */
traceEVENT_GROUP_CREATE_FAILED();
}else { ... }
return pxEventBits;
}xEventGroupCreateStatic (StaticEventGroup_t *pxEventGroupBuffer) { ... }
/* ... */
#endif
#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
EventGroupHandle_t xEventGroupCreate( void )
{
EventGroup_t *pxEventBits;
/* ... */
pxEventBits = ( EventGroup_t * ) pvPortMalloc( sizeof( EventGroup_t ) );
if( pxEventBits != NULL )
{
pxEventBits->uxEventBits = 0;
vListInitialise( &( pxEventBits->xTasksWaitingForBits ) );
#if( configSUPPORT_STATIC_ALLOCATION == 1 )
{
/* ... */
pxEventBits->ucStaticallyAllocated = pdFALSE;
...}/* ... */
#endif
traceEVENT_GROUP_CREATE( pxEventBits );
}if (pxEventBits != NULL) { ... }
else
{
traceEVENT_GROUP_CREATE_FAILED();
}else { ... }
return pxEventBits;
}{ ... }
/* ... */#endif
EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, const EventBits_t uxBitsToWaitFor, TickType_t xTicksToWait )
{
EventBits_t uxOriginalBitValue, uxReturn;
EventGroup_t *pxEventBits = xEventGroup;
BaseType_t xAlreadyYielded;
BaseType_t xTimeoutOccurred = pdFALSE;
configASSERT( ( uxBitsToWaitFor & eventEVENT_BITS_CONTROL_BYTES ) == 0 );
configASSERT( uxBitsToWaitFor != 0 );
#if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
{
configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
...}/* ... */
#endif
vTaskSuspendAll();
{
uxOriginalBitValue = pxEventBits->uxEventBits;
( void ) xEventGroupSetBits( xEventGroup, uxBitsToSet );
if( ( ( uxOriginalBitValue | uxBitsToSet ) & uxBitsToWaitFor ) == uxBitsToWaitFor )
{
uxReturn = ( uxOriginalBitValue | uxBitsToSet );
/* ... */
pxEventBits->uxEventBits &= ~uxBitsToWaitFor;
xTicksToWait = 0;
}if (( ( uxOriginalBitValue | uxBitsToSet ) & uxBitsToWaitFor ) == uxBitsToWaitFor) { ... }
else
{
if( xTicksToWait != ( TickType_t ) 0 )
{
traceEVENT_GROUP_SYNC_BLOCK( xEventGroup, uxBitsToSet, uxBitsToWaitFor );
/* ... */
vTaskPlaceOnUnorderedEventList( &( pxEventBits->xTasksWaitingForBits ), ( uxBitsToWaitFor | eventCLEAR_EVENTS_ON_EXIT_BIT | eventWAIT_FOR_ALL_BITS ), xTicksToWait );
/* ... */
uxReturn = 0;
}if (xTicksToWait != ( TickType_t ) 0) { ... }
else
{
/* ... */
uxReturn = pxEventBits->uxEventBits;
xTimeoutOccurred = pdTRUE;
}else { ... }
}else { ... }
...}
xAlreadyYielded = xTaskResumeAll();
if( xTicksToWait != ( TickType_t ) 0 )
{
if( xAlreadyYielded == pdFALSE )
{
portYIELD_WITHIN_API();
}if (xAlreadyYielded == pdFALSE) { ... }
else
{
mtCOVERAGE_TEST_MARKER();
}else { ... }
/* ... */
uxReturn = uxTaskResetEventItemValue();
if( ( uxReturn & eventUNBLOCKED_DUE_TO_BIT_SET ) == ( EventBits_t ) 0 )
{
taskENTER_CRITICAL();
{
uxReturn = pxEventBits->uxEventBits;
/* ... */
if( ( uxReturn & uxBitsToWaitFor ) == uxBitsToWaitFor )
{
pxEventBits->uxEventBits &= ~uxBitsToWaitFor;
}if (( uxReturn & uxBitsToWaitFor ) == uxBitsToWaitFor) { ... }
else
{
mtCOVERAGE_TEST_MARKER();
}else { ... }
...}
taskEXIT_CRITICAL();
xTimeoutOccurred = pdTRUE;
}if (( uxReturn & eventUNBLOCKED_DUE_TO_BIT_SET ) == ( EventBits_t ) 0) { ... }
else
{
}else { ... }
/* ... */
uxReturn &= ~eventEVENT_BITS_CONTROL_BYTES;
}if (xTicksToWait != ( TickType_t ) 0) { ... }
traceEVENT_GROUP_SYNC_END( xEventGroup, uxBitsToSet, uxBitsToWaitFor, xTimeoutOccurred );
( void ) xTimeoutOccurred;
return uxReturn;
}{ ... }
EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToWaitFor, const BaseType_t xClearOnExit, const BaseType_t xWaitForAllBits, TickType_t xTicksToWait )
{
EventGroup_t *pxEventBits = xEventGroup;
EventBits_t uxReturn, uxControlBits = 0;
BaseType_t xWaitConditionMet, xAlreadyYielded;
BaseType_t xTimeoutOccurred = pdFALSE;
/* ... */
configASSERT( xEventGroup );
configASSERT( ( uxBitsToWaitFor & eventEVENT_BITS_CONTROL_BYTES ) == 0 );
configASSERT( uxBitsToWaitFor != 0 );
#if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
{
configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );
...}/* ... */
#endif
vTaskSuspendAll();
{
const EventBits_t uxCurrentEventBits = pxEventBits->uxEventBits;
xWaitConditionMet = prvTestWaitCondition( uxCurrentEventBits, uxBitsToWaitFor, xWaitForAllBits );
if( xWaitConditionMet != pdFALSE )
{
/* ... */
uxReturn = uxCurrentEventBits;
xTicksToWait = ( TickType_t ) 0;
if( xClearOnExit != pdFALSE )
{
pxEventBits->uxEventBits &= ~uxBitsToWaitFor;
}if (xClearOnExit != pdFALSE) { ... }
else
{
mtCOVERAGE_TEST_MARKER();
}else { ... }
}if (xWaitConditionMet != pdFALSE) { ... }
else if( xTicksToWait == ( TickType_t ) 0 )
{
/* ... */
uxReturn = uxCurrentEventBits;
xTimeoutOccurred = pdTRUE;
}else if (xTicksToWait == ( TickType_t ) 0) { ... }
else
{
/* ... */
if( xClearOnExit != pdFALSE )
{
uxControlBits |= eventCLEAR_EVENTS_ON_EXIT_BIT;
}if (xClearOnExit != pdFALSE) { ... }
else
{
mtCOVERAGE_TEST_MARKER();
}else { ... }
if( xWaitForAllBits != pdFALSE )
{
uxControlBits |= eventWAIT_FOR_ALL_BITS;
}if (xWaitForAllBits != pdFALSE) { ... }
else
{
mtCOVERAGE_TEST_MARKER();
}else { ... }
/* ... */
vTaskPlaceOnUnorderedEventList( &( pxEventBits->xTasksWaitingForBits ), ( uxBitsToWaitFor | uxControlBits ), xTicksToWait );
/* ... */
uxReturn = 0;
traceEVENT_GROUP_WAIT_BITS_BLOCK( xEventGroup, uxBitsToWaitFor );
}else { ... }
...}
xAlreadyYielded = xTaskResumeAll();
if( xTicksToWait != ( TickType_t ) 0 )
{
if( xAlreadyYielded == pdFALSE )
{
portYIELD_WITHIN_API();
}if (xAlreadyYielded == pdFALSE) { ... }
else
{
mtCOVERAGE_TEST_MARKER();
}else { ... }
/* ... */
uxReturn = uxTaskResetEventItemValue();
if( ( uxReturn & eventUNBLOCKED_DUE_TO_BIT_SET ) == ( EventBits_t ) 0 )
{
taskENTER_CRITICAL();
{
uxReturn = pxEventBits->uxEventBits;
/* ... */
if( prvTestWaitCondition( uxReturn, uxBitsToWaitFor, xWaitForAllBits ) != pdFALSE )
{
if( xClearOnExit != pdFALSE )
{
pxEventBits->uxEventBits &= ~uxBitsToWaitFor;
}if (xClearOnExit != pdFALSE) { ... }
else
{
mtCOVERAGE_TEST_MARKER();
}else { ... }
}if (prvTestWaitCondition( uxReturn, uxBitsToWaitFor, xWaitForAllBits ) != pdFALSE) { ... }
else
{
mtCOVERAGE_TEST_MARKER();
}else { ... }
xTimeoutOccurred = pdTRUE;
...}
taskEXIT_CRITICAL();
}if (( uxReturn & eventUNBLOCKED_DUE_TO_BIT_SET ) == ( EventBits_t ) 0) { ... }
else
{
}else { ... }
uxReturn &= ~eventEVENT_BITS_CONTROL_BYTES;
}if (xTicksToWait != ( TickType_t ) 0) { ... }
traceEVENT_GROUP_WAIT_BITS_END( xEventGroup, uxBitsToWaitFor, xTimeoutOccurred );
( void ) xTimeoutOccurred;
return uxReturn;
}{ ... }
EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear )
{
EventGroup_t *pxEventBits = xEventGroup;
EventBits_t uxReturn;
/* ... */
configASSERT( xEventGroup );
configASSERT( ( uxBitsToClear & eventEVENT_BITS_CONTROL_BYTES ) == 0 );
taskENTER_CRITICAL();
{
traceEVENT_GROUP_CLEAR_BITS( xEventGroup, uxBitsToClear );
/* ... */
uxReturn = pxEventBits->uxEventBits;
pxEventBits->uxEventBits &= ~uxBitsToClear;
...}
taskEXIT_CRITICAL();
return uxReturn;
}{ ... }
#if ( ( configUSE_TRACE_FACILITY == 1 ) && ( INCLUDE_xTimerPendFunctionCall == 1 ) && ( configUSE_TIMERS == 1 ) )
BaseType_t xEventGroupClearBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear )
{
BaseType_t xReturn;
traceEVENT_GROUP_CLEAR_BITS_FROM_ISR( xEventGroup, uxBitsToClear );
xReturn = xTimerPendFunctionCallFromISR( vEventGroupClearBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToClear, NULL );
return xReturn;
}xEventGroupClearBitsFromISR (EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear) { ... }
/* ... */
#endif
EventBits_t xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup )
{
UBaseType_t uxSavedInterruptStatus;
EventGroup_t const * const pxEventBits = xEventGroup;
EventBits_t uxReturn;
uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();
{
uxReturn = pxEventBits->uxEventBits;
...}
portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );
return uxReturn;
}{ ... }
EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet )
{
ListItem_t *pxListItem, *pxNext;
ListItem_t const *pxListEnd;
List_t const * pxList;
EventBits_t uxBitsToClear = 0, uxBitsWaitedFor, uxControlBits;
EventGroup_t *pxEventBits = xEventGroup;
BaseType_t xMatchFound = pdFALSE;
/* ... */
configASSERT( xEventGroup );
configASSERT( ( uxBitsToSet & eventEVENT_BITS_CONTROL_BYTES ) == 0 );
pxList = &( pxEventBits->xTasksWaitingForBits );
pxListEnd = listGET_END_MARKER( pxList );
vTaskSuspendAll();
{
traceEVENT_GROUP_SET_BITS( xEventGroup, uxBitsToSet );
pxListItem = listGET_HEAD_ENTRY( pxList );
pxEventBits->uxEventBits |= uxBitsToSet;
while( pxListItem != pxListEnd )
{
pxNext = listGET_NEXT( pxListItem );
uxBitsWaitedFor = listGET_LIST_ITEM_VALUE( pxListItem );
xMatchFound = pdFALSE;
uxControlBits = uxBitsWaitedFor & eventEVENT_BITS_CONTROL_BYTES;
uxBitsWaitedFor &= ~eventEVENT_BITS_CONTROL_BYTES;
if( ( uxControlBits & eventWAIT_FOR_ALL_BITS ) == ( EventBits_t ) 0 )
{
if( ( uxBitsWaitedFor & pxEventBits->uxEventBits ) != ( EventBits_t ) 0 )
{
xMatchFound = pdTRUE;
}if (( uxBitsWaitedFor & pxEventBits->uxEventBits ) != ( EventBits_t ) 0) { ... }
else
{
mtCOVERAGE_TEST_MARKER();
}else { ... }
}if (( uxControlBits & eventWAIT_FOR_ALL_BITS ) == ( EventBits_t ) 0) { ... }
else if( ( uxBitsWaitedFor & pxEventBits->uxEventBits ) == uxBitsWaitedFor )
{
xMatchFound = pdTRUE;
}else if (( uxBitsWaitedFor & pxEventBits->uxEventBits ) == uxBitsWaitedFor) { ... }
else
{
}else { ... }
if( xMatchFound != pdFALSE )
{
if( ( uxControlBits & eventCLEAR_EVENTS_ON_EXIT_BIT ) != ( EventBits_t ) 0 )
{
uxBitsToClear |= uxBitsWaitedFor;
}if (( uxControlBits & eventCLEAR_EVENTS_ON_EXIT_BIT ) != ( EventBits_t ) 0) { ... }
else
{
mtCOVERAGE_TEST_MARKER();
}else { ... }
/* ... */
vTaskRemoveFromUnorderedEventList( pxListItem, pxEventBits->uxEventBits | eventUNBLOCKED_DUE_TO_BIT_SET );
}if (xMatchFound != pdFALSE) { ... }
/* ... */
pxListItem = pxNext;
}while (pxListItem != pxListEnd) { ... }
/* ... */
pxEventBits->uxEventBits &= ~uxBitsToClear;
...}
( void ) xTaskResumeAll();
return pxEventBits->uxEventBits;
}{ ... }
void vEventGroupDelete( EventGroupHandle_t xEventGroup )
{
EventGroup_t *pxEventBits = xEventGroup;
const List_t *pxTasksWaitingForBits = &( pxEventBits->xTasksWaitingForBits );
vTaskSuspendAll();
{
traceEVENT_GROUP_DELETE( xEventGroup );
while( listCURRENT_LIST_LENGTH( pxTasksWaitingForBits ) > ( UBaseType_t ) 0 )
{
/* ... */
configASSERT( pxTasksWaitingForBits->xListEnd.pxNext != ( const ListItem_t * ) &( pxTasksWaitingForBits->xListEnd ) );
vTaskRemoveFromUnorderedEventList( pxTasksWaitingForBits->xListEnd.pxNext, eventUNBLOCKED_DUE_TO_BIT_SET );
}while (listCURRENT_LIST_LENGTH( pxTasksWaitingForBits ) > ( UBaseType_t ) 0) { ... }
#if( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 0 ) )
{
/* ... */
vPortFree( pxEventBits );
...}/* ... */
#elif( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
{
/* ... */
if( pxEventBits->ucStaticallyAllocated == ( uint8_t ) pdFALSE )
{
vPortFree( pxEventBits );
}if (pxEventBits->ucStaticallyAllocated == ( uint8_t ) pdFALSE) { ... }
else
{
mtCOVERAGE_TEST_MARKER();
}else { ... }
...}/* ... */
#endif
...}
( void ) xTaskResumeAll();
}{ ... }
/* ... */
void vEventGroupSetBitsCallback( void *pvEventGroup, const uint32_t ulBitsToSet )
{
( void ) xEventGroupSetBits( pvEventGroup, ( EventBits_t ) ulBitsToSet );
}{ ... }
/* ... */
void vEventGroupClearBitsCallback( void *pvEventGroup, const uint32_t ulBitsToClear )
{
( void ) xEventGroupClearBits( pvEventGroup, ( EventBits_t ) ulBitsToClear );
}{ ... }
static BaseType_t prvTestWaitCondition( const EventBits_t uxCurrentEventBits, const EventBits_t uxBitsToWaitFor, const BaseType_t xWaitForAllBits )
{
BaseType_t xWaitConditionMet = pdFALSE;
if( xWaitForAllBits == pdFALSE )
{
/* ... */
if( ( uxCurrentEventBits & uxBitsToWaitFor ) != ( EventBits_t ) 0 )
{
xWaitConditionMet = pdTRUE;
}if (( uxCurrentEventBits & uxBitsToWaitFor ) != ( EventBits_t ) 0) { ... }
else
{
mtCOVERAGE_TEST_MARKER();
}else { ... }
}if (xWaitForAllBits == pdFALSE) { ... }
else
{
/* ... */
if( ( uxCurrentEventBits & uxBitsToWaitFor ) == uxBitsToWaitFor )
{
xWaitConditionMet = pdTRUE;
}if (( uxCurrentEventBits & uxBitsToWaitFor ) == uxBitsToWaitFor) { ... }
else
{
mtCOVERAGE_TEST_MARKER();
}else { ... }
}else { ... }
return xWaitConditionMet;
}{ ... }
#if ( ( configUSE_TRACE_FACILITY == 1 ) && ( INCLUDE_xTimerPendFunctionCall == 1 ) && ( configUSE_TIMERS == 1 ) )
BaseType_t xEventGroupSetBitsFromISR( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, BaseType_t *pxHigherPriorityTaskWoken )
{
BaseType_t xReturn;
traceEVENT_GROUP_SET_BITS_FROM_ISR( xEventGroup, uxBitsToSet );
xReturn = xTimerPendFunctionCallFromISR( vEventGroupSetBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToSet, pxHigherPriorityTaskWoken );
return xReturn;
}xEventGroupSetBitsFromISR (EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, BaseType_t *pxHigherPriorityTaskWoken) { ... }
/* ... */
#endif
#if (configUSE_TRACE_FACILITY == 1)
UBaseType_t uxEventGroupGetNumber( void* xEventGroup )
{
UBaseType_t xReturn;
EventGroup_t const *pxEventBits = ( EventGroup_t * ) xEventGroup;
if( xEventGroup == NULL )
{
xReturn = 0;
}if (xEventGroup == NULL) { ... }
else
{
xReturn = pxEventBits->uxEventGroupNumber;
}else { ... }
return xReturn;
}{ ... }
/* ... */#endif
#if ( configUSE_TRACE_FACILITY == 1 )
void vEventGroupSetNumber( void * xEventGroup, UBaseType_t uxEventGroupNumber )
{
( ( EventGroup_t * ) xEventGroup )->uxEventGroupNumber = uxEventGroupNumber;
}{ ... }
/* ... */#endif