@@ -625,49 +625,45 @@ EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup,
625
625
626
626
void vEventGroupDelete ( EventGroupHandle_t xEventGroup )
627
627
{
628
- EventGroup_t * pxEventBits ;
629
- const List_t * pxTasksWaitingForBits ;
628
+ configASSERT ( xEventGroup );
629
+
630
+ EventGroup_t * pxEventBits = xEventGroup ;
631
+ const List_t * pxTasksWaitingForBits = & ( pxEventBits -> xTasksWaitingForBits );
630
632
631
- if ( NULL != xEventGroup )
633
+ vTaskSuspendAll ();
632
634
{
633
- pxEventBits = xEventGroup ;
634
- pxTasksWaitingForBits = & ( pxEventBits -> xTasksWaitingForBits );
635
+ traceEVENT_GROUP_DELETE ( xEventGroup );
635
636
636
- vTaskSuspendAll ();
637
+ while ( listCURRENT_LIST_LENGTH ( pxTasksWaitingForBits ) > ( UBaseType_t ) 0 )
637
638
{
638
- traceEVENT_GROUP_DELETE ( xEventGroup );
639
+ /* Unblock the task, returning 0 as the event list is being deleted
640
+ * and cannot therefore have any bits set. */
641
+ configASSERT ( pxTasksWaitingForBits -> xListEnd .pxNext != ( const ListItem_t * ) & ( pxTasksWaitingForBits -> xListEnd ) );
642
+ vTaskRemoveFromUnorderedEventList ( pxTasksWaitingForBits -> xListEnd .pxNext , eventUNBLOCKED_DUE_TO_BIT_SET );
643
+ }
639
644
640
- while ( listCURRENT_LIST_LENGTH ( pxTasksWaitingForBits ) > ( UBaseType_t ) 0 )
645
+ #if ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 0 ) )
641
646
{
642
- /* Unblock the task, returning 0 as the event list is being deleted
643
- * and cannot therefore have any bits set. */
644
- configASSERT ( pxTasksWaitingForBits -> xListEnd .pxNext != ( const ListItem_t * ) & ( pxTasksWaitingForBits -> xListEnd ) );
645
- vTaskRemoveFromUnorderedEventList ( pxTasksWaitingForBits -> xListEnd .pxNext , eventUNBLOCKED_DUE_TO_BIT_SET );
647
+ /* The event group can only have been allocated dynamically - free
648
+ * it again. */
649
+ vPortFree ( pxEventBits );
646
650
}
647
-
648
- #if ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 0 ) )
651
+ #elif ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
652
+ {
653
+ /* The event group could have been allocated statically or
654
+ * dynamically, so check before attempting to free the memory. */
655
+ if ( pxEventBits -> ucStaticallyAllocated == ( uint8_t ) pdFALSE )
649
656
{
650
- /* The event group can only have been allocated dynamically - free
651
- * it again. */
652
657
vPortFree ( pxEventBits );
653
658
}
654
- #elif ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
659
+ else
655
660
{
656
- /* The event group could have been allocated statically or
657
- * dynamically, so check before attempting to free the memory. */
658
- if ( pxEventBits -> ucStaticallyAllocated == ( uint8_t ) pdFALSE )
659
- {
660
- vPortFree ( pxEventBits );
661
- }
662
- else
663
- {
664
- mtCOVERAGE_TEST_MARKER ();
665
- }
661
+ mtCOVERAGE_TEST_MARKER ();
666
662
}
667
- #endif /* configSUPPORT_DYNAMIC_ALLOCATION */
668
- }
669
- ( void ) xTaskResumeAll ();
663
+ }
664
+ #endif /* configSUPPORT_DYNAMIC_ALLOCATION */
670
665
}
666
+ ( void ) xTaskResumeAll ();
671
667
}
672
668
/*-----------------------------------------------------------*/
673
669
0 commit comments