+static TickType_t uxTick = ( TickType_t ) -1;\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
+ callback before their expiry time, but a margin is permissible for calling\r
+ their callback after their expiry time. If exact timing is required then\r
+ configTIMER_TASK_PRIORITY must be set to ensure the timer service task\r
+ is the highest priority task in the system.\r
+\r
+ This function is called from the tick hook. The tick hook is called\r
+ even when the scheduler is suspended. Therefore it is possible that the\r
+ uxTick count maintained in this function is temporarily ahead of the tick\r
+ count maintained by the kernel. When this is the case a message posted from\r
+ this function will assume a time stamp in advance of the real time stamp,\r
+ which can result in a timer being processed before this function expects it\r
+ to. For example, if the kernel's tick count was 100, and uxTick was 102,\r
+ then this function will not expect the timer to have expired until the\r
+ kernel's tick count is (102 + xBasePeriod), whereas in reality the timer\r
+ will expire when the kernel's tick count is (100 + xBasePeriod). For this\r
+ reason xMargin is used as an allowable margin for premature timer expiries\r
+ as well as late timer expiries. */\r
+ #ifdef _WINDOWS_\r
+ /* Windows is not real real time. */\r
+ const TickType_t xMargin = 20;\r
+ #else\r
+ const TickType_t xMargin = 6;\r
+ #endif /* _WINDOWS_ */\r
+#else\r
+ #ifdef _WINDOWS_\r
+ /* Windows is not real real time. */\r
+ const TickType_t xMargin = 20;\r
+ #else\r
+ const TickType_t xMargin = 4;\r
+ #endif /* _WINDOWS_ */\r
+#endif\r