mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-29 22:48:37 -04:00
Common demo tasks:
- Add additional tests to GenQTest.c to test the updated priority inheritance mechanism. - Slightly increase some delays in recmutex.c to prevent it reporting false errors in high load test cases. SAMA5D3 Xplained IAR demo: - Remove space being allocated for stacks that are not used. - Remove explicit enabling of interrupts in ISR handers as this is now done from the central ISR callback before the individual handers are invoked. - Reduce both the allocated heap size and the stack allocated to each task. - Enable I cache.
This commit is contained in:
parent
47f895cb34
commit
60538c7480
21 changed files with 214 additions and 597 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS V8.0.1 - Copyright (C) 2014 Real Time Engineers Ltd.
|
||||
FreeRTOS V8.0.1 - Copyright (C) 2014 Real Time Engineers Ltd.
|
||||
All rights reserved
|
||||
|
||||
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
|
||||
|
@ -210,7 +210,7 @@ static void prvTimerTestTask( void *pvParameters )
|
|||
/* Check the auto reload timers can be stopped correctly, and correctly
|
||||
report their state. */
|
||||
prvTest4_CheckAutoReloadTimersCanBeStopped();
|
||||
|
||||
|
||||
/* Check the one shot timer only calls its callback once after it has been
|
||||
started, and that it reports its state correctly. */
|
||||
prvTest5_CheckBasicOneShotTimerBehaviour();
|
||||
|
@ -238,7 +238,7 @@ static TickType_t xIterationsWithoutCounterIncrement = ( TickType_t ) 0, xLastCy
|
|||
elsewhere. Start counting Iterations again. */
|
||||
xIterationsWithoutCounterIncrement = ( TickType_t ) 0;
|
||||
xLastCycleFrequency = xCycleFrequency;
|
||||
}
|
||||
}
|
||||
|
||||
/* Calculate the maximum number of times that it is permissible for this
|
||||
function to be called without ulLoopCounter being incremented. This is
|
||||
|
@ -336,7 +336,7 @@ UBaseType_t xTimer;
|
|||
configASSERT( xTestStatus );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Create the timers that are used from the tick interrupt to test the timer
|
||||
API functions that can be called from an ISR. */
|
||||
xISRAutoReloadTimer = xTimerCreate( "ISR AR", /* The text name given to the timer. */
|
||||
|
@ -350,7 +350,7 @@ UBaseType_t xTimer;
|
|||
pdFALSE, /* This is a one shot timer. */
|
||||
( void * ) NULL, /* The identifier is not required. */
|
||||
prvISROneShotTimerCallback ); /* The callback that is executed when the timer expires. */
|
||||
|
||||
|
||||
if( ( xISRAutoReloadTimer == NULL ) || ( xISROneShotTimer == NULL ) )
|
||||
{
|
||||
xTestStatus = pdFAIL;
|
||||
|
@ -394,13 +394,13 @@ TickType_t xBlockPeriod, xTimerPeriod, xExpectedNumber;
|
|||
|
||||
/* Check the auto reload timers expire at the expected rates. */
|
||||
|
||||
|
||||
|
||||
/* Delaying for configTIMER_QUEUE_LENGTH * xBasePeriod ticks should allow
|
||||
all the auto reload timers to expire at least once. */
|
||||
xBlockPeriod = ( ( TickType_t ) configTIMER_QUEUE_LENGTH ) * xBasePeriod;
|
||||
vTaskDelay( xBlockPeriod );
|
||||
|
||||
/* Check that all the auto reload timers have called their callback
|
||||
/* Check that all the auto reload timers have called their callback
|
||||
function the expected number of times. */
|
||||
for( ucTimer = 0; ucTimer < ( uint8_t ) configTIMER_QUEUE_LENGTH; ucTimer++ )
|
||||
{
|
||||
|
@ -408,7 +408,7 @@ TickType_t xBlockPeriod, xTimerPeriod, xExpectedNumber;
|
|||
by the timer period. */
|
||||
xTimerPeriod = ( ( ( TickType_t ) ucTimer + ( TickType_t ) 1 ) * xBasePeriod );
|
||||
xExpectedNumber = xBlockPeriod / xTimerPeriod;
|
||||
|
||||
|
||||
ucMaxAllowableValue = ( ( uint8_t ) xExpectedNumber ) ;
|
||||
ucMinAllowableValue = ( uint8_t ) ( ( uint8_t ) xExpectedNumber - ( uint8_t ) 1 ); /* Weird casting to try and please all compilers. */
|
||||
|
||||
|
@ -431,7 +431,7 @@ TickType_t xBlockPeriod, xTimerPeriod, xExpectedNumber;
|
|||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvTest4_CheckAutoReloadTimersCanBeStopped( void )
|
||||
{
|
||||
{
|
||||
uint8_t ucTimer;
|
||||
|
||||
/* Check the auto reload timers can be stopped correctly, and correctly
|
||||
|
@ -749,7 +749,7 @@ static TickType_t uxTick = ( TickType_t ) -1;
|
|||
|
||||
if( uxTick == 0 )
|
||||
{
|
||||
/* The timers will have been created, but not started. Start them now
|
||||
/* The timers will have been created, but not started. Start them now
|
||||
by setting their period. */
|
||||
ucISRAutoReloadTimerCounter = 0;
|
||||
ucISROneShotTimerCounter = 0;
|
||||
|
@ -765,7 +765,7 @@ static TickType_t uxTick = ( TickType_t ) -1;
|
|||
/* First timer was started, try starting the second timer. */
|
||||
if( xTimerChangePeriodFromISR( xISROneShotTimer, xBasePeriod, NULL ) == pdPASS )
|
||||
{
|
||||
/* Both timers were started, so set the uxTick back to its
|
||||
/* Both timers were started, so set the uxTick back to its
|
||||
proper value. */
|
||||
uxTick = 0;
|
||||
}
|
||||
|
@ -805,7 +805,7 @@ static TickType_t uxTick = ( TickType_t ) -1;
|
|||
{
|
||||
xTestStatus = pdFAIL;
|
||||
configASSERT( xTestStatus );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if( uxTick == ( ( 2 * xBasePeriod ) + xMargin ) )
|
||||
{
|
||||
|
@ -817,7 +817,7 @@ static TickType_t uxTick = ( TickType_t ) -1;
|
|||
xTestStatus = pdFAIL;
|
||||
configASSERT( xTestStatus );
|
||||
}
|
||||
|
||||
|
||||
if( ucISROneShotTimerCounter != 1 )
|
||||
{
|
||||
xTestStatus = pdFAIL;
|
||||
|
@ -834,13 +834,13 @@ static TickType_t uxTick = ( TickType_t ) -1;
|
|||
xTestStatus = pdFAIL;
|
||||
configASSERT( xTestStatus );
|
||||
}
|
||||
|
||||
|
||||
if( ucISROneShotTimerCounter != 1 )
|
||||
{
|
||||
xTestStatus = pdFAIL;
|
||||
configASSERT( xTestStatus );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if( uxTick == ( 3 * xBasePeriod ) )
|
||||
{
|
||||
/* Start the one shot timer again. */
|
||||
|
@ -856,17 +856,17 @@ static TickType_t uxTick = ( TickType_t ) -1;
|
|||
xTestStatus = pdFAIL;
|
||||
configASSERT( xTestStatus );
|
||||
}
|
||||
|
||||
|
||||
if( ucISROneShotTimerCounter != 1 )
|
||||
{
|
||||
xTestStatus = pdFAIL;
|
||||
configASSERT( xTestStatus );
|
||||
}
|
||||
|
||||
|
||||
/* Now stop the auto reload timer. The one shot timer was started
|
||||
a few ticks ago. */
|
||||
xTimerStopFromISR( xISRAutoReloadTimer, NULL );
|
||||
}
|
||||
}
|
||||
else if( uxTick == ( 4 * ( xBasePeriod - xMargin ) ) )
|
||||
{
|
||||
/* The auto reload timer is now stopped, and the one shot timer is
|
||||
|
@ -877,13 +877,13 @@ static TickType_t uxTick = ( TickType_t ) -1;
|
|||
xTestStatus = pdFAIL;
|
||||
configASSERT( xTestStatus );
|
||||
}
|
||||
|
||||
|
||||
if( ucISROneShotTimerCounter != 1 )
|
||||
{
|
||||
xTestStatus = pdFAIL;
|
||||
configASSERT( xTestStatus );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if( uxTick == ( ( 4 * xBasePeriod ) + xMargin ) )
|
||||
{
|
||||
/* The auto reload timer is now stopped, and the one shot timer is
|
||||
|
@ -894,13 +894,13 @@ static TickType_t uxTick = ( TickType_t ) -1;
|
|||
xTestStatus = pdFAIL;
|
||||
configASSERT( xTestStatus );
|
||||
}
|
||||
|
||||
|
||||
if( ucISROneShotTimerCounter != 2 )
|
||||
{
|
||||
xTestStatus = pdFAIL;
|
||||
configASSERT( xTestStatus );
|
||||
}
|
||||
}
|
||||
}
|
||||
else if( uxTick == ( 8 * xBasePeriod ) )
|
||||
{
|
||||
/* The auto reload timer is now stopped, and the one shot timer has
|
||||
|
@ -911,16 +911,16 @@ static TickType_t uxTick = ( TickType_t ) -1;
|
|||
xTestStatus = pdFAIL;
|
||||
configASSERT( xTestStatus );
|
||||
}
|
||||
|
||||
|
||||
if( ucISROneShotTimerCounter != 2 )
|
||||
{
|
||||
xTestStatus = pdFAIL;
|
||||
configASSERT( xTestStatus );
|
||||
}
|
||||
|
||||
|
||||
/* Now reset the one shot timer. */
|
||||
xTimerResetFromISR( xISROneShotTimer, NULL );
|
||||
}
|
||||
}
|
||||
else if( uxTick == ( ( 9 * xBasePeriod ) - xMargin ) )
|
||||
{
|
||||
/* Only the one shot timer should be running, but it should not have
|
||||
|
@ -931,15 +931,15 @@ static TickType_t uxTick = ( TickType_t ) -1;
|
|||
xTestStatus = pdFAIL;
|
||||
configASSERT( xTestStatus );
|
||||
}
|
||||
|
||||
|
||||
if( ucISROneShotTimerCounter != 2 )
|
||||
{
|
||||
xTestStatus = pdFAIL;
|
||||
configASSERT( xTestStatus );
|
||||
}
|
||||
|
||||
|
||||
xTimerResetFromISR( xISROneShotTimer, NULL );
|
||||
}
|
||||
}
|
||||
else if( uxTick == ( ( 10 * xBasePeriod ) - ( 2 * xMargin ) ) )
|
||||
{
|
||||
/* Only the one shot timer should be running, but it should not have
|
||||
|
@ -950,13 +950,13 @@ static TickType_t uxTick = ( TickType_t ) -1;
|
|||
xTestStatus = pdFAIL;
|
||||
configASSERT( xTestStatus );
|
||||
}
|
||||
|
||||
|
||||
if( ucISROneShotTimerCounter != 2 )
|
||||
{
|
||||
xTestStatus = pdFAIL;
|
||||
configASSERT( xTestStatus );
|
||||
}
|
||||
|
||||
|
||||
xTimerResetFromISR( xISROneShotTimer, NULL );
|
||||
}
|
||||
else if( uxTick == ( ( 11 * xBasePeriod ) - ( 3 * xMargin ) ) )
|
||||
|
@ -969,15 +969,15 @@ static TickType_t uxTick = ( TickType_t ) -1;
|
|||
xTestStatus = pdFAIL;
|
||||
configASSERT( xTestStatus );
|
||||
}
|
||||
|
||||
|
||||
if( ucISROneShotTimerCounter != 2 )
|
||||
{
|
||||
xTestStatus = pdFAIL;
|
||||
configASSERT( xTestStatus );
|
||||
}
|
||||
|
||||
|
||||
xTimerResetFromISR( xISROneShotTimer, NULL );
|
||||
}
|
||||
}
|
||||
else if( uxTick == ( ( 12 * xBasePeriod ) - ( 2 * xMargin ) ) )
|
||||
{
|
||||
/* Only the one shot timer should have been running and this time it
|
||||
|
@ -990,7 +990,7 @@ static TickType_t uxTick = ( TickType_t ) -1;
|
|||
xTestStatus = pdFAIL;
|
||||
configASSERT( xTestStatus );
|
||||
}
|
||||
|
||||
|
||||
if( ucISROneShotTimerCounter != 3 )
|
||||
{
|
||||
xTestStatus = pdFAIL;
|
||||
|
@ -1007,15 +1007,15 @@ static TickType_t uxTick = ( TickType_t ) -1;
|
|||
xTestStatus = pdFAIL;
|
||||
configASSERT( xTestStatus );
|
||||
}
|
||||
|
||||
|
||||
if( ucISROneShotTimerCounter != 3 )
|
||||
{
|
||||
xTestStatus = pdFAIL;
|
||||
configASSERT( xTestStatus );
|
||||
}
|
||||
|
||||
|
||||
uxTick = ( TickType_t ) -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue