necessary because the tests in this file block for extended periods, and the\r
block period might be longer than the time between calls to this function. */\r
xMaxBlockTimeUsedByTheseTests = ( ( portTickType ) configTIMER_QUEUE_LENGTH ) * xBasePeriod;\r
- xLoopCounterIncrementTimeMax = xMaxBlockTimeUsedByTheseTests / xCycleFrequency;\r
+ xLoopCounterIncrementTimeMax = ( xMaxBlockTimeUsedByTheseTests / xCycleFrequency ) + 1;\r
\r
- /* If the demo task is still running then we expect the loopcounter to\r
+ /* If the demo task is still running then the loop counter is expected to\r
have incremented every xLoopCounterIncrementTimeMax calls. */\r
if( ulLastLoopCounter == ulLoopCounter )\r
{\r
{\r
static portTickType uxTick = ( portTickType ) -1;\r
\r
-/* The xHigherPriorityTaskWoken parameter is not used in this case as this\r
-function is called from the tick hook anyway. However the API required it\r
-to be present. */\r
-signed portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;\r
-\r
#if( configTIMER_TASK_PRIORITY != ( configMAX_PRIORITIES - 1 ) )\r
/* The timer service task is not the highest priority task, so it cannot\r
be assumed that timings will be exact. Timers should never call their\r
is the highest priority task in the system. */\r
const portTickType xMargin = 5;\r
#else\r
-\r
- const portTickType xMargin = 1;\r
+ const portTickType xMargin = 2;\r
#endif\r
\r
- /* This test is called from the tick ISR even when the scheduler is suspended.\r
- Therefore, it is possible for the xTickCount to be temporarily less than the\r
- uxTicks count maintained in this function. That can result in calculated\r
- unblock times being too short, as this function is not called as missed ticks\r
- (ticks that occur while the scheduler is suspended) are unwound to reinstate\r
- the real tick value. Therefore, if this happens, just abandon the test\r
- and start again. */\r
- if( xTaskGetSchedulerState() != taskSCHEDULER_RUNNING )\r
- {\r
- uxTick = ( portTickType ) -1;\r
- }\r
- else\r
- {\r
- uxTick++;\r
- }\r
+ uxTick++;\r
\r
- if( uxTick == ( xBasePeriod >> 1 ) )\r
+ if( uxTick == 0 )\r
{\r
- /* The timers will have been created, but not started. Start them\r
- now by setting their period. */\r
+ /* The timers will have been created, but not started. Start them now \r
+ by setting their period. */\r
ucISRAutoReloadTimerCounter = 0;\r
ucISROneShotTimerCounter = 0;\r
\r
timer queue. If the timers cannot be started then reset uxTick so\r
another attempt is made later. */\r
uxTick = ( portTickType ) -1;\r
- if( xTimerChangePeriodFromISR( xISRAutoReloadTimer, xBasePeriod, &xHigherPriorityTaskWoken ) == pdPASS )\r
+\r
+ /* Try starting first timer. */\r
+ if( xTimerChangePeriodFromISR( xISRAutoReloadTimer, xBasePeriod, NULL ) == pdPASS )\r
{\r
- if( xTimerChangePeriodFromISR( xISROneShotTimer, xBasePeriod, &xHigherPriorityTaskWoken ) == pdPASS )\r
+ /* First timer was started, try starting the second timer. */\r
+ if( xTimerChangePeriodFromISR( xISROneShotTimer, xBasePeriod, NULL ) == pdPASS )\r
{\r
+ /* Both timers were started, so set the uxTick back to its \r
+ proper value. */\r
uxTick = 0;\r
}\r
else\r
{\r
- xTimerStopFromISR( xISRAutoReloadTimer, &xHigherPriorityTaskWoken );\r
+ /* Second timer could not be started, so stop the first one\r
+ again. */\r
+ xTimerStopFromISR( xISRAutoReloadTimer, NULL );\r
}\r
}\r
}\r
else if( uxTick == ( 3 * xBasePeriod ) )\r
{\r
/* Start the one shot timer again. */\r
- xTimerStartFromISR( xISROneShotTimer, &xHigherPriorityTaskWoken );\r
+ xTimerStartFromISR( xISROneShotTimer, NULL );\r
}\r
else if( uxTick == ( ( 3 * xBasePeriod ) + xMargin ) )\r
{\r
\r
/* Now stop the auto reload timer. The one shot timer was started\r
a few ticks ago. */\r
- xTimerStopFromISR( xISRAutoReloadTimer, &xHigherPriorityTaskWoken );\r
+ xTimerStopFromISR( xISRAutoReloadTimer, NULL );\r
} \r
else if( uxTick == ( 4 * xBasePeriod ) )\r
{\r
}\r
\r
/* Now reset the one shot timer. */\r
- xTimerResetFromISR( xISROneShotTimer, &xHigherPriorityTaskWoken );\r
+ xTimerResetFromISR( xISROneShotTimer, NULL );\r
} \r
else if( uxTick == ( 9 * xBasePeriod ) )\r
{\r
configASSERT( xTestStatus );\r
}\r
\r
- xTimerResetFromISR( xISROneShotTimer, &xHigherPriorityTaskWoken );\r
+ xTimerResetFromISR( xISROneShotTimer, NULL );\r
} \r
else if( uxTick == ( 10 * xBasePeriod ) )\r
{\r
configASSERT( xTestStatus );\r
}\r
\r
- xTimerResetFromISR( xISROneShotTimer, &xHigherPriorityTaskWoken );\r
+ xTimerResetFromISR( xISROneShotTimer, NULL );\r
}\r
else if( uxTick == ( 11 * xBasePeriod ) )\r
{\r
configASSERT( xTestStatus );\r
}\r
\r
- xTimerResetFromISR( xISROneShotTimer, &xHigherPriorityTaskWoken );\r
+ xTimerResetFromISR( xISROneShotTimer, NULL );\r
} \r
else if( uxTick == ( ( 12 * xBasePeriod ) + xMargin ) )\r
{\r