portBASE_TYPE xTimerListsWereSwitched, xResult;\r
portTickType xTimeNow;\r
\r
- /* In this case the xTimerListsWereSwitched parameter is not used, but it\r
- must be present in the function call. */\r
- xTimeNow = prvSampleTimeNow( &xTimerListsWereSwitched );\r
-\r
while( xQueueReceive( xTimerQueue, &xMessage, tmrNO_DELAY ) != pdFAIL )\r
{\r
pxTimer = xMessage.pxTimer;\r
\r
traceTIMER_COMMAND_RECEIVED( pxTimer, xMessage.xMessageID, xMessage.xMessageValue );\r
\r
+ /* In this case the xTimerListsWereSwitched parameter is not used, but \r
+ it must be present in the function call. prvSampleTimeNow() must be \r
+ called after the message is received from xTimerQueue so there is no \r
+ possibility of a higher priority task adding a message to the message\r
+ queue with a time that is ahead of the timer daemon task (because it\r
+ pre-empted the timer daemon task after the xTimeNow value was set). */\r
+ xTimeNow = prvSampleTimeNow( &xTimerListsWereSwitched );\r
+\r
switch( xMessage.xMessageID )\r
{\r
case tmrCOMMAND_START :\r
to include software timer functionality. If you want to include software timer\r
functionality then ensure configUSE_TIMERS is set to 1 in FreeRTOSConfig.h. */\r
#endif /* configUSE_TIMERS == 1 */\r
+\r
+\r
+\r