mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-24 20:18:37 -04:00
Ensure the code builds when configSUPPORT_STATIC_ALLOCATION is 0.
Continue to document the new static allocation functions.
This commit is contained in:
parent
f82953554d
commit
8ef7849199
7 changed files with 336 additions and 54 deletions
|
@ -151,14 +151,18 @@ EventGroup_t *pxEventBits;
|
|||
pxEventBits->uxEventBits = 0;
|
||||
vListInitialise( &( pxEventBits->xTasksWaitingForBits ) );
|
||||
|
||||
if( pxStaticEventGroup == NULL )
|
||||
#if( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
{
|
||||
pxEventBits->ucStaticallyAllocated = pdFALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
pxEventBits->ucStaticallyAllocated = pdTRUE;
|
||||
if( pxStaticEventGroup == NULL )
|
||||
{
|
||||
pxEventBits->ucStaticallyAllocated = pdFALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
pxEventBits->ucStaticallyAllocated = pdTRUE;
|
||||
}
|
||||
}
|
||||
#endif /* configSUPPORT_STATIC_ALLOCATION */
|
||||
|
||||
traceEVENT_GROUP_CREATE( pxEventBits );
|
||||
}
|
||||
|
@ -605,10 +609,18 @@ const List_t *pxTasksWaitingForBits = &( pxEventBits->xTasksWaitingForBits );
|
|||
}
|
||||
|
||||
/* Only free the memory if it was allocated dynamically. */
|
||||
if( pxEventBits->ucStaticallyAllocated == pdFALSE )
|
||||
#if( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
{
|
||||
if( pxEventBits->ucStaticallyAllocated == pdFALSE )
|
||||
{
|
||||
vPortFree( pxEventBits );
|
||||
}
|
||||
}
|
||||
#else
|
||||
{
|
||||
vPortFree( pxEventBits );
|
||||
}
|
||||
#endif /* configSUPPORT_STATIC_ALLOCATION */
|
||||
}
|
||||
( void ) xTaskResumeAll();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue