Skip to content

Commit

Permalink
Fix xStreamBufferCreateStatic() API for buffer size 1 (FreeRTOS#793)
Browse files Browse the repository at this point in the history
  • Loading branch information
kar-rahul-aws committed Sep 13, 2023
1 parent 2f94b18 commit 26c48de
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions stream_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,23 +417,23 @@ static void prvInitialiseNewStreamBuffer( StreamBuffer_t * const pxStreamBuffer,
xTriggerLevelBytes = ( size_t ) 1;
}

/* In case the stream buffer is going to be used as a message buffer
* (that is, it will hold discrete messages with a little meta data that
* says how big the next message is) check the buffer will be large enough
* to hold at least one message. */

if( xIsMessageBuffer != pdFALSE )
{
/* Statically allocated message buffer. */
ucFlags = sbFLAGS_IS_MESSAGE_BUFFER | sbFLAGS_IS_STATICALLY_ALLOCATED;
configASSERT( xBufferSizeBytes > sbBYTES_TO_STORE_MESSAGE_LENGTH );
}
else
{
/* Statically allocated stream buffer. */
ucFlags = sbFLAGS_IS_STATICALLY_ALLOCATED;
}

/* In case the stream buffer is going to be used as a message buffer
* (that is, it will hold discrete messages with a little meta data that
* says how big the next message is) check the buffer will be large enough
* to hold at least one message. */
configASSERT( xBufferSizeBytes > sbBYTES_TO_STORE_MESSAGE_LENGTH );

#if ( configASSERT_DEFINED == 1 )
{
/* Sanity check that the size of the structure used to declare a
Expand Down

0 comments on commit 26c48de

Please sign in to comment.