mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-19 09:38:32 -04:00
Add functions to get the buffers of statically created objects (#641)
Added various ...GetStaticBuffer() functions to get the buffers of statically created objects. --------- Co-authored-by: Paul Bartell <pbartell@amazon.com> Co-authored-by: Nikhil Kamath <110539926+amazonKamath@users.noreply.github.com> Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
This commit is contained in:
parent
d4d5e43292
commit
9488ba22d8
13 changed files with 400 additions and 0 deletions
|
@ -472,6 +472,34 @@ static void prvInitialiseNewStreamBuffer( StreamBuffer_t * const pxStreamBuffer,
|
|||
#endif /* ( configSUPPORT_STATIC_ALLOCATION == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
BaseType_t xStreamBufferGetStaticBuffers( StreamBufferHandle_t xStreamBuffer,
|
||||
uint8_t ** ppucStreamBufferStorageArea,
|
||||
StaticStreamBuffer_t ** ppxStaticStreamBuffer )
|
||||
{
|
||||
BaseType_t xReturn;
|
||||
const StreamBuffer_t * const pxStreamBuffer = xStreamBuffer;
|
||||
|
||||
configASSERT( pxStreamBuffer );
|
||||
configASSERT( ppucStreamBufferStorageArea );
|
||||
configASSERT( ppxStaticStreamBuffer );
|
||||
|
||||
if( ( pxStreamBuffer->ucFlags & sbFLAGS_IS_STATICALLY_ALLOCATED ) != ( uint8_t ) 0 )
|
||||
{
|
||||
*ppucStreamBufferStorageArea = pxStreamBuffer->pucBuffer;
|
||||
*ppxStaticStreamBuffer = ( StaticStreamBuffer_t * ) pxStreamBuffer;
|
||||
xReturn = pdTRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
xReturn = pdFALSE;
|
||||
}
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
#endif /* configSUPPORT_STATIC_ALLOCATION */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer )
|
||||
{
|
||||
StreamBuffer_t * pxStreamBuffer = xStreamBuffer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue