* timer list does not contain any timers then return 0 and set *pxListWasEmpty\r
* to pdTRUE.\r
*/\r
-static portTickType prvLookForExpiredTimer( portBASE_TYPE *pxListWasEmpty ) PRIVILEGED_FUNCTION;\r
+static portTickType prvGetNextExpireTime( portBASE_TYPE *pxListWasEmpty ) PRIVILEGED_FUNCTION;\r
\r
/*\r
* If a timer has expired, process it. Otherwise, block the timer service task\r
static void prvProcessExpiredTimer( portTickType xNextExpireTime, portTickType xTimeNow )\r
{\r
xTIMER *pxTimer;\r
+portBASE_TYPE xResult;\r
\r
/* Remove the timer from the list of active timers. A check has already\r
been performed to ensure the list is not empty. */\r
{\r
/* The timer expired before it was added to the active timer\r
list. Reload it now. */\r
- xTimerGenericCommand( pxTimer, tmrCOMMAND_START, xNextExpireTime, NULL, tmrNO_DELAY );\r
+ xResult = xTimerGenericCommand( pxTimer, tmrCOMMAND_START, xNextExpireTime, NULL, tmrNO_DELAY );\r
+ configASSERT( xResult );\r
+ ( void ) xResult;\r
}\r
}\r
\r
{\r
/* Query the timers list to see if it contains any timers, and if so,\r
obtain the time at which the next timer will expire. */\r
- xNextExpireTime = prvLookForExpiredTimer( &xListWasEmpty );\r
+ xNextExpireTime = prvGetNextExpireTime( &xListWasEmpty );\r
\r
/* If a timer has expired, process it. Otherwise, block this task\r
until either a timer does expire, or a command is received. */\r
/* The tick count has not overflowed, has the timer expired? */\r
if( ( xListWasEmpty == pdFALSE ) && ( xNextExpireTime <= xTimeNow ) )\r
{\r
+ xTaskResumeAll();\r
prvProcessExpiredTimer( xNextExpireTime, xTimeNow );\r
}\r
else\r
be reached unless xNextExpireTime > xTimeNow, except in the\r
case when the current timer list is empty. */\r
vQueueWaitForMessageRestricted( xTimerQueue, ( xNextExpireTime - xTimeNow ) );\r
+\r
+ if( xTaskResumeAll() == pdFALSE )\r
+ {\r
+ /* Yield to wait for either a command to arrive, or the block time\r
+ to expire. If a command arrived between the critical section being\r
+ exited and this yield then the yield will not cause the task\r
+ to block. */\r
+ portYIELD_WITHIN_API();\r
+ }\r
}\r
}\r
- }\r
- if( xTaskResumeAll() == pdFALSE )\r
- {\r
- /* Yield to wait for either a command to arrive, or the block time\r
- to expire. If a command arrived between the critical section being\r
- exited and this yield then the yield will not cause the task\r
- to block. */\r
- portYIELD_WITHIN_API();\r
+ else\r
+ {\r
+ xTaskResumeAll();\r
+ }\r
}\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static portTickType prvLookForExpiredTimer( portBASE_TYPE *pxListWasEmpty )\r
+static portTickType prvGetNextExpireTime( portBASE_TYPE *pxListWasEmpty )\r
{\r
portTickType xNextExpireTime;\r
\r
{\r
xTIMER_MESSAGE xMessage;\r
xTIMER *pxTimer;\r
-portBASE_TYPE xTimerListsWereSwitched;\r
+portBASE_TYPE xTimerListsWereSwitched, xResult;\r
portTickType xTimeNow;\r
\r
/* In this case the xTimerListsWereSwitched parameter is not used, but it\r
\r
if( pxTimer->uxAutoReload == pdTRUE )\r
{\r
- xTimerGenericCommand( pxTimer, tmrCOMMAND_START, xMessage.xMessageValue + pxTimer->xTimerPeriodInTicks, NULL, tmrNO_DELAY );\r
+ xResult = xTimerGenericCommand( pxTimer, tmrCOMMAND_START, xMessage.xMessageValue + pxTimer->xTimerPeriodInTicks, NULL, tmrNO_DELAY );\r
+ configASSERT( xResult );\r
+ ( void ) xResult;\r
}\r
}\r
break;\r
portTickType xNextExpireTime;\r
xList *pxTemp;\r
xTIMER *pxTimer;\r
+portBASE_TYPE xResult;\r
\r
/* Remove compiler warnings if configASSERT() is not defined. */\r
( void ) xLastTime;\r
pxTimer->pxCallbackFunction( ( xTimerHandle ) pxTimer );\r
if( pxTimer->uxAutoReload == pdTRUE )\r
{\r
- xTimerGenericCommand( pxTimer, tmrCOMMAND_START, xNextExpireTime, NULL, tmrNO_DELAY );\r
+ xResult = xTimerGenericCommand( pxTimer, tmrCOMMAND_START, xNextExpireTime, NULL, tmrNO_DELAY );\r
+ configASSERT( xResult );\r
+ ( void ) xResult;\r
}\r
}\r
\r