Add configUSE_MINI_LIST_ITEM configuration option to enable the MiniListItem_t type. (#433)
* Add configUSE_MINI_LIST_ITEM configuration option to enable the MiniListItem_t type. When configUSE_MINI_LIST_ITEM == 0: MiniListItem_t and ListItem_t are both typedefs of struct xLIST_ITEM. When configUSE_MINI_LIST_ITEM == 1 (the default in projdefs.h): MiniListItem_t is a typedef of struct xMINI_LIST_ITEM, which contains 3 fewer fields than a struct xLIST_ITEM. This configuration saves approximately sizeof(TickType_t) + 2 * sizeof( void * ) bytes of ram, however it also violates strict aliasing rules which some compilers depend on for optimization. configUSE_MINI_LIST_ITEM defaults to 1 when not defined. * Add pp_indent_brace option to uncrustify config Improves compliance with the FreeRTOS code style guide: https://www.freertos.org/FreeRTOS-Coding-Standard-and-Style-Guide.html
This commit is contained in:
@ -345,13 +345,13 @@ static void prvInitialiseNewStreamBuffer( StreamBuffer_t * const pxStreamBuffer,
|
||||
configASSERT( xBufferSizeBytes > sbBYTES_TO_STORE_MESSAGE_LENGTH );
|
||||
|
||||
#if ( configASSERT_DEFINED == 1 )
|
||||
{
|
||||
/* Sanity check that the size of the structure used to declare a
|
||||
* variable of type StaticStreamBuffer_t equals the size of the real
|
||||
* message buffer structure. */
|
||||
volatile size_t xSize = sizeof( StaticStreamBuffer_t );
|
||||
configASSERT( xSize == sizeof( StreamBuffer_t ) );
|
||||
} /*lint !e529 xSize is referenced is configASSERT() is defined. */
|
||||
{
|
||||
/* Sanity check that the size of the structure used to declare a
|
||||
* variable of type StaticStreamBuffer_t equals the size of the real
|
||||
* message buffer structure. */
|
||||
volatile size_t xSize = sizeof( StaticStreamBuffer_t );
|
||||
configASSERT( xSize == sizeof( StreamBuffer_t ) );
|
||||
} /*lint !e529 xSize is referenced is configASSERT() is defined. */
|
||||
#endif /* configASSERT_DEFINED */
|
||||
|
||||
if( ( pucStreamBufferStorageArea != NULL ) && ( pxStaticStreamBuffer != NULL ) )
|
||||
@ -393,17 +393,17 @@ void vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer )
|
||||
if( ( pxStreamBuffer->ucFlags & sbFLAGS_IS_STATICALLY_ALLOCATED ) == ( uint8_t ) pdFALSE )
|
||||
{
|
||||
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
|
||||
{
|
||||
/* Both the structure and the buffer were allocated using a single call
|
||||
* to pvPortMalloc(), hence only one call to vPortFree() is required. */
|
||||
vPortFree( ( void * ) pxStreamBuffer ); /*lint !e9087 Standard free() semantics require void *, plus pxStreamBuffer was allocated by pvPortMalloc(). */
|
||||
}
|
||||
{
|
||||
/* Both the structure and the buffer were allocated using a single call
|
||||
* to pvPortMalloc(), hence only one call to vPortFree() is required. */
|
||||
vPortFree( ( void * ) pxStreamBuffer ); /*lint !e9087 Standard free() semantics require void *, plus pxStreamBuffer was allocated by pvPortMalloc(). */
|
||||
}
|
||||
#else
|
||||
{
|
||||
/* Should not be possible to get here, ucFlags must be corrupt.
|
||||
* Force an assert. */
|
||||
configASSERT( xStreamBuffer == ( StreamBufferHandle_t ) ~0 );
|
||||
}
|
||||
{
|
||||
/* Should not be possible to get here, ucFlags must be corrupt.
|
||||
* Force an assert. */
|
||||
configASSERT( xStreamBuffer == ( StreamBufferHandle_t ) ~0 );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
@ -427,11 +427,11 @@ BaseType_t xStreamBufferReset( StreamBufferHandle_t xStreamBuffer )
|
||||
configASSERT( pxStreamBuffer );
|
||||
|
||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||
{
|
||||
/* Store the stream buffer number so it can be restored after the
|
||||
* reset. */
|
||||
uxStreamBufferNumber = pxStreamBuffer->uxStreamBufferNumber;
|
||||
}
|
||||
{
|
||||
/* Store the stream buffer number so it can be restored after the
|
||||
* reset. */
|
||||
uxStreamBufferNumber = pxStreamBuffer->uxStreamBufferNumber;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Can only reset a message buffer if there are no tasks blocked on it. */
|
||||
@ -449,9 +449,9 @@ BaseType_t xStreamBufferReset( StreamBufferHandle_t xStreamBuffer )
|
||||
xReturn = pdPASS;
|
||||
|
||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||
{
|
||||
pxStreamBuffer->uxStreamBufferNumber = uxStreamBufferNumber;
|
||||
}
|
||||
{
|
||||
pxStreamBuffer->uxStreamBufferNumber = uxStreamBufferNumber;
|
||||
}
|
||||
#endif
|
||||
|
||||
traceSTREAM_BUFFER_RESET( xStreamBuffer );
|
||||
@ -1266,13 +1266,13 @@ static void prvInitialiseNewStreamBuffer( StreamBuffer_t * const pxStreamBuffer,
|
||||
* be written to without generating exceptions, and is setting the buffer to a
|
||||
* known value to assist in development/debugging. */
|
||||
#if ( configASSERT_DEFINED == 1 )
|
||||
{
|
||||
/* The value written just has to be identifiable when looking at the
|
||||
* memory. Don't use 0xA5 as that is the stack fill value and could
|
||||
* result in confusion as to what is actually being observed. */
|
||||
const BaseType_t xWriteValue = 0x55;
|
||||
configASSERT( memset( pucBuffer, ( int ) xWriteValue, xBufferSizeBytes ) == pucBuffer );
|
||||
} /*lint !e529 !e438 xWriteValue is only used if configASSERT() is defined. */
|
||||
{
|
||||
/* The value written just has to be identifiable when looking at the
|
||||
* memory. Don't use 0xA5 as that is the stack fill value and could
|
||||
* result in confusion as to what is actually being observed. */
|
||||
const BaseType_t xWriteValue = 0x55;
|
||||
configASSERT( memset( pucBuffer, ( int ) xWriteValue, xBufferSizeBytes ) == pucBuffer );
|
||||
} /*lint !e529 !e438 xWriteValue is only used if configASSERT() is defined. */
|
||||
#endif
|
||||
|
||||
( void ) memset( ( void * ) pxStreamBuffer, 0x00, sizeof( StreamBuffer_t ) ); /*lint !e9087 memset() requires void *. */
|
||||
|
Reference in New Issue
Block a user