uint8_t * const pucBuffer,\r
size_t xBufferSizeBytes,\r
size_t xTriggerLevelBytes,\r
- BaseType_t xIsMessageBuffer ) PRIVILEGED_FUNCTION;\r
+ uint8_t ucFlags ) PRIVILEGED_FUNCTION;\r
\r
/*-----------------------------------------------------------*/\r
\r
StreamBufferHandle_t xStreamBufferGenericCreate( size_t xBufferSizeBytes, size_t xTriggerLevelBytes, BaseType_t xIsMessageBuffer )\r
{\r
uint8_t *pucAllocatedMemory;\r
+ uint8_t ucFlags;\r
\r
/* In case the stream buffer is going to be used as a message buffer\r
(that is, it will hold discrete messages with a little meta data that\r
to hold at least one message. */\r
if( xIsMessageBuffer == pdTRUE )\r
{\r
+ /* Is a message buffer but not statically allocated. */\r
+ ucFlags = sbFLAGS_IS_MESSAGE_BUFFER;\r
configASSERT( xBufferSizeBytes > sbBYTES_TO_STORE_MESSAGE_LENGTH );\r
}\r
else\r
{\r
+ /* Not a message buffer and not statically allocated. */\r
+ ucFlags = 0;\r
configASSERT( xBufferSizeBytes > 0 );\r
}\r
configASSERT( xTriggerLevelBytes <= xBufferSizeBytes );\r
pucAllocatedMemory + sizeof( StreamBuffer_t ), /* Storage area follows. */ /*lint !e9016 Indexing past structure valid for uint8_t pointer, also storage area has no alignment requirement. */\r
xBufferSizeBytes,\r
xTriggerLevelBytes,\r
- xIsMessageBuffer );\r
+ ucFlags );\r
\r
traceSTREAM_BUFFER_CREATE( ( ( StreamBuffer_t * ) pucAllocatedMemory ), xIsMessageBuffer );\r
}\r
{\r
StreamBuffer_t * const pxStreamBuffer = ( StreamBuffer_t * ) pxStaticStreamBuffer; /*lint !e740 !e9087 Safe cast as StaticStreamBuffer_t is opaque Streambuffer_t. */\r
StreamBufferHandle_t xReturn;\r
+ uint8_t ucFlags;\r
\r
configASSERT( pucStreamBufferStorageArea );\r
configASSERT( pxStaticStreamBuffer );\r
xTriggerLevelBytes = ( size_t ) 1;\r
}\r
\r
+ if( xIsMessageBuffer != pdFALSE )\r
+ {\r
+ /* Statically allocated message buffer. */\r
+ ucFlags = sbFLAGS_IS_MESSAGE_BUFFER | sbFLAGS_IS_STATICALLY_ALLOCATED;\r
+ }\r
+ else\r
+ {\r
+ /* Statically allocated stream buffer. */\r
+ ucFlags = sbFLAGS_IS_STATICALLY_ALLOCATED;\r
+ }\r
+\r
/* In case the stream buffer is going to be used as a message buffer\r
(that is, it will hold discrete messages with a little meta data that\r
says how big the next message is) check the buffer will be large enough\r
pucStreamBufferStorageArea,\r
xBufferSizeBytes,\r
xTriggerLevelBytes,\r
- xIsMessageBuffer );\r
+ ucFlags );\r
\r
/* Remember this was statically allocated in case it is ever deleted\r
again. */\r
BaseType_t xStreamBufferReset( StreamBufferHandle_t xStreamBuffer )\r
{\r
StreamBuffer_t * const pxStreamBuffer = xStreamBuffer;\r
-BaseType_t xReturn = pdFAIL, xIsMessageBuffer;\r
+BaseType_t xReturn = pdFAIL;\r
\r
#if( configUSE_TRACE_FACILITY == 1 )\r
UBaseType_t uxStreamBufferNumber;\r
{\r
if( pxStreamBuffer->xTaskWaitingToSend == NULL )\r
{\r
- if( ( pxStreamBuffer->ucFlags & sbFLAGS_IS_MESSAGE_BUFFER ) != ( uint8_t ) 0 )\r
- {\r
- xIsMessageBuffer = pdTRUE;\r
- }\r
- else\r
- {\r
- xIsMessageBuffer = pdFALSE;\r
- }\r
-\r
prvInitialiseNewStreamBuffer( pxStreamBuffer,\r
pxStreamBuffer->pucBuffer,\r
pxStreamBuffer->xLength,\r
pxStreamBuffer->xTriggerLevelBytes,\r
- xIsMessageBuffer );\r
+ pxStreamBuffer->ucFlags );\r
xReturn = pdPASS;\r
\r
#if( configUSE_TRACE_FACILITY == 1 )\r
uint8_t * const pucBuffer,\r
size_t xBufferSizeBytes,\r
size_t xTriggerLevelBytes,\r
- BaseType_t xIsMessageBuffer )\r
+ uint8_t ucFlags )\r
{\r
/* Assert here is deliberately writing to the entire buffer to ensure it can\r
be written to without generating exceptions, and is setting the buffer to a\r
pxStreamBuffer->pucBuffer = pucBuffer;\r
pxStreamBuffer->xLength = xBufferSizeBytes;\r
pxStreamBuffer->xTriggerLevelBytes = xTriggerLevelBytes;\r
-\r
- if( xIsMessageBuffer != pdFALSE )\r
- {\r
- pxStreamBuffer->ucFlags |= sbFLAGS_IS_MESSAGE_BUFFER;\r
- }\r
+ pxStreamBuffer->ucFlags = ucFlags;\r
}\r
\r
#if ( configUSE_TRACE_FACILITY == 1 )\r