]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/event_groups.c
Ensure the code builds when configSUPPORT_STATIC_ALLOCATION is 0.
[freertos] / FreeRTOS / Source / event_groups.c
index 4d0ba5b8ad0705627a699e3a44a363972569a652..246e28651e806c794300a5018ef5281f018f065a 100644 (file)
@@ -151,14 +151,18 @@ EventGroup_t *pxEventBits;
                pxEventBits->uxEventBits = 0;\r
                vListInitialise( &( pxEventBits->xTasksWaitingForBits ) );\r
 \r
-               if( pxStaticEventGroup == NULL )\r
+               #if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
                {\r
-                       pxEventBits->ucStaticallyAllocated = pdFALSE;\r
-               }\r
-               else\r
-               {\r
-                       pxEventBits->ucStaticallyAllocated = pdTRUE;\r
+                       if( pxStaticEventGroup == NULL )\r
+                       {\r
+                               pxEventBits->ucStaticallyAllocated = pdFALSE;\r
+                       }\r
+                       else\r
+                       {\r
+                               pxEventBits->ucStaticallyAllocated = pdTRUE;\r
+                       }\r
                }\r
+               #endif /* configSUPPORT_STATIC_ALLOCATION */\r
 \r
                traceEVENT_GROUP_CREATE( pxEventBits );\r
        }\r
@@ -605,10 +609,18 @@ const List_t *pxTasksWaitingForBits = &( pxEventBits->xTasksWaitingForBits );
                }\r
 \r
                /* Only free the memory if it was allocated dynamically. */\r
-               if( pxEventBits->ucStaticallyAllocated == pdFALSE )\r
+               #if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
+               {\r
+                       if( pxEventBits->ucStaticallyAllocated == pdFALSE )\r
+                       {\r
+                               vPortFree( pxEventBits );\r
+                       }\r
+               }\r
+               #else\r
                {\r
                        vPortFree( pxEventBits );\r
                }\r
+               #endif /* configSUPPORT_STATIC_ALLOCATION */\r
        }\r
        ( void ) xTaskResumeAll();\r
 }\r