+ /* Timers are listed in expiry time order, with the head of the list\r
+ referencing the task that will expire first. Obtain the time at which\r
+ the timer with the nearest expiry time will expire. If there are no\r
+ active timers then just set the next expire time to 0. That will cause\r
+ this task to unblock when the tick count overflows, at which point the\r
+ timer lists will be switched and the next expiry time can be \r
+ re-assessed. */\r
+ *pxListWasEmpty = listLIST_IS_EMPTY( pxCurrentTimerList );\r
+ if( *pxListWasEmpty == pdFALSE )\r
+ {\r
+ xNextExpireTime = listGET_ITEM_VALUE_OF_HEAD_ENTRY( pxCurrentTimerList );\r
+ }\r
+ else\r
+ {\r
+ /* Ensure the task unblocks when the tick count rolls over. */\r
+ xNextExpireTime = ( portTickType ) 0U;\r
+ }\r
+\r
+ return xNextExpireTime;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static portTickType prvSampleTimeNow( portBASE_TYPE *pxTimerListsWereSwitched )\r
+{\r
+portTickType xTimeNow;\r
+static portTickType xLastTime = ( portTickType ) 0U;\r
+\r
+ xTimeNow = xTaskGetTickCount();\r
+ \r
+ if( xTimeNow < xLastTime )\r
+ {\r
+ prvSwitchTimerLists( xTimeNow, xLastTime );\r
+ *pxTimerListsWereSwitched = pdTRUE;\r
+ }\r
+ else\r
+ {\r
+ *pxTimerListsWereSwitched = pdFALSE;\r