diff --git a/FreeRTOS/Demo/Common/Minimal/StreamBufferDemo.c b/FreeRTOS/Demo/Common/Minimal/StreamBufferDemo.c index 17214f104..e940f2b60 100644 --- a/FreeRTOS/Demo/Common/Minimal/StreamBufferDemo.c +++ b/FreeRTOS/Demo/Common/Minimal/StreamBufferDemo.c @@ -560,7 +560,7 @@ static void prvSingleTaskTests( StreamBufferHandle_t xStreamBuffer ) /* Ensure data was written as expected even when there was an attempt to * write more than was available. This also tries to read more bytes than are * available. */ - xReturned = xStreamBufferReceive( xStreamBuffer, ( void * ) pucFullBuffer, xFullBufferSize, xMinimalBlockTime ); + xStreamBufferReceive( xStreamBuffer, ( void * ) pucFullBuffer, xFullBufferSize, xMinimalBlockTime ); prvCheckExpectedState( memcmp( ( const void * ) pucFullBuffer, ( const void * ) pc54ByteString, sbSTREAM_BUFFER_LENGTH_BYTES ) == 0 ); prvCheckExpectedState( xStreamBufferIsFull( xStreamBuffer ) == pdFALSE ); prvCheckExpectedState( xStreamBufferIsEmpty( xStreamBuffer ) == pdTRUE ); diff --git a/FreeRTOS/Demo/Common/Minimal/TaskNotify.c b/FreeRTOS/Demo/Common/Minimal/TaskNotify.c index b87c9d646..67a3d8b1a 100644 --- a/FreeRTOS/Demo/Common/Minimal/TaskNotify.c +++ b/FreeRTOS/Demo/Common/Minimal/TaskNotify.c @@ -242,6 +242,7 @@ static void prvSingleTaskTests( void ) configASSERT( xReturned == pdPASS ); ( void ) xReturned; /* In case configASSERT() is not defined. */ xReturned = xTaskNotifyWait( notifyUINT32_MAX, 0, &ulNotifiedValue, 0 ); + configASSERT( xReturned == pdPASS ); configASSERT( ulNotifiedValue == ulSecondNotifiedValueConst ); ( void ) ulNotifiedValue; /* In case configASSERT() is not defined. */ diff --git a/FreeRTOS/Demo/Common/Minimal/TimerDemo.c b/FreeRTOS/Demo/Common/Minimal/TimerDemo.c index 0a86e8e63..ec01afeda 100644 --- a/FreeRTOS/Demo/Common/Minimal/TimerDemo.c +++ b/FreeRTOS/Demo/Common/Minimal/TimerDemo.c @@ -230,8 +230,10 @@ static void prvTimerTestTask( void * pvParameters ) BaseType_t xAreTimerDemoTasksStillRunning( TickType_t xCycleFrequency ) { static uint32_t ulLastLoopCounter = 0UL; - TickType_t xMaxBlockTimeUsedByTheseTests, xLoopCounterIncrementTimeMax; static TickType_t xIterationsWithoutCounterIncrement = ( TickType_t ) 0, xLastCycleFrequency; + TickType_t xMaxBlockTimeUsedByTheseTests, xLoopCounterIncrementTimeMax; + + configASSERT( xCycleFrequency != 0UL ); if( xLastCycleFrequency != xCycleFrequency ) { @@ -241,17 +243,17 @@ BaseType_t xAreTimerDemoTasksStillRunning( TickType_t xCycleFrequency ) xLastCycleFrequency = xCycleFrequency; } - /* Calculate the maximum number of times that it is permissible for this - * function to be called without ulLoopCounter being incremented. This is - * necessary because the tests in this file block for extended periods, and the - * block period might be longer than the time between calls to this function. */ - xMaxBlockTimeUsedByTheseTests = ( ( TickType_t ) configTIMER_QUEUE_LENGTH ) * xBasePeriod; - xLoopCounterIncrementTimeMax = ( xMaxBlockTimeUsedByTheseTests / xCycleFrequency ) + 1; - /* If the demo task is still running then the loop counter is expected to * have incremented every xLoopCounterIncrementTimeMax calls. */ if( ulLastLoopCounter == ulLoopCounter ) { + /* Calculate the maximum number of times that it is permissible for this + * function to be called without ulLoopCounter being incremented. This is + * necessary because the tests in this file block for extended periods, and the + * block period might be longer than the time between calls to this function. */ + xMaxBlockTimeUsedByTheseTests = ( ( TickType_t ) configTIMER_QUEUE_LENGTH ) * xBasePeriod; + xLoopCounterIncrementTimeMax = ( xMaxBlockTimeUsedByTheseTests / xCycleFrequency ) + 1; + xIterationsWithoutCounterIncrement++; if( xIterationsWithoutCounterIncrement > xLoopCounterIncrementTimeMax )