MCPcopy Create free account
hub / github.com/FreeRTOS/FreeRTOS-Kernel / xStreamBufferIsFull

Function xStreamBufferIsFull

stream_buffer.c:1034–1066  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1032/*-----------------------------------------------------------*/
1033
1034BaseType_t xStreamBufferIsFull( StreamBufferHandle_t xStreamBuffer )
1035{
1036 BaseType_t xReturn;
1037 size_t xBytesToStoreMessageLength;
1038 const StreamBuffer_t * const pxStreamBuffer = xStreamBuffer;
1039
1040 configASSERT( pxStreamBuffer );
1041
1042 /* This generic version of the receive function is used by both message
1043 * buffers, which store discrete messages, and stream buffers, which store a
1044 * continuous stream of bytes. Discrete messages include an additional
1045 * sbBYTES_TO_STORE_MESSAGE_LENGTH bytes that hold the length of the message. */
1046 if( ( pxStreamBuffer->ucFlags & sbFLAGS_IS_MESSAGE_BUFFER ) != ( uint8_t ) 0 )
1047 {
1048 xBytesToStoreMessageLength = sbBYTES_TO_STORE_MESSAGE_LENGTH;
1049 }
1050 else
1051 {
1052 xBytesToStoreMessageLength = 0;
1053 }
1054
1055 /* True if the available space equals zero. */
1056 if( xStreamBufferSpacesAvailable( xStreamBuffer ) <= xBytesToStoreMessageLength )
1057 {
1058 xReturn = pdTRUE;
1059 }
1060 else
1061 {
1062 xReturn = pdFALSE;
1063 }
1064
1065 return xReturn;
1066}
1067/*-----------------------------------------------------------*/
1068
1069BaseType_t xStreamBufferSendCompletedFromISR( StreamBufferHandle_t xStreamBuffer,

Callers 1

MPU_xStreamBufferIsFullFunction · 0.85

Calls 1

Tested by

no test coverage detected