Ensure the code builds when configSUPPORT_STATIC_ALLOCATION is 0.

Continue to document the new static allocation functions.
This commit is contained in:
Richard Barry 2016-01-22 22:09:11 +00:00
parent f82953554d
commit 8ef7849199
7 changed files with 336 additions and 54 deletions

View file

@ -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();
}