|
49 | 49 | #undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e961 !e750 !e9021. */ |
50 | 50 |
|
51 | 51 | /* If the user has not provided application specific Rx notification macros, |
52 | | - * or #defined the notification macros away, them provide default implementations |
| 52 | + * or #defined the notification macros away, then provide default implementations |
53 | 53 | * that uses task notifications. */ |
54 | 54 | /*lint -save -e9026 Function like macros allowed and needed here so they can be overridden. */ |
55 | 55 | #ifndef sbRECEIVE_COMPLETED |
@@ -267,7 +267,6 @@ static void prvInitialiseNewStreamBuffer( StreamBuffer_t * const pxStreamBuffer, |
267 | 267 | { |
268 | 268 | pucAllocatedMemory = NULL; |
269 | 269 | } |
270 | | - |
271 | 270 |
|
272 | 271 | if( pucAllocatedMemory != NULL ) |
273 | 272 | { |
@@ -466,7 +465,7 @@ BaseType_t xStreamBufferSetTriggerLevel( StreamBufferHandle_t xStreamBuffer, |
466 | 465 |
|
467 | 466 | /* The trigger level is the number of bytes that must be in the stream |
468 | 467 | * buffer before a task that is waiting for data is unblocked. */ |
469 | | - if( xTriggerLevel <= pxStreamBuffer->xLength ) |
| 468 | + if( xTriggerLevel < pxStreamBuffer->xLength ) |
470 | 469 | { |
471 | 470 | pxStreamBuffer->xTriggerLevelBytes = xTriggerLevel; |
472 | 471 | xReturn = pdPASS; |
@@ -525,14 +524,15 @@ size_t xStreamBufferSend( StreamBufferHandle_t xStreamBuffer, |
525 | 524 | size_t xReturn, xSpace = 0; |
526 | 525 | size_t xRequiredSpace = xDataLengthBytes; |
527 | 526 | TimeOut_t xTimeOut; |
528 | | - |
529 | | - /* The maximum amount of space a stream buffer will ever report is its length |
530 | | - * minus 1. */ |
531 | | - const size_t xMaxReportedSpace = pxStreamBuffer->xLength - ( size_t ) 1; |
| 527 | + size_t xMaxReportedSpace = 0; |
532 | 528 |
|
533 | 529 | configASSERT( pvTxData ); |
534 | 530 | configASSERT( pxStreamBuffer ); |
535 | 531 |
|
| 532 | + /* The maximum amount of space a stream buffer will ever report is its length |
| 533 | + * minus 1. */ |
| 534 | + xMaxReportedSpace = pxStreamBuffer->xLength - ( size_t ) 1; |
| 535 | + |
536 | 536 | /* This send function is used to write to both message buffers and stream |
537 | 537 | * buffers. If this is a message buffer then the space needed must be |
538 | 538 | * increased by the amount of bytes needed to store the length of the |
|
0 commit comments