\r
static DWORD WINAPI prvSimulatedPeripheralTimer( LPVOID lpParameter )\r
{\r
-void *pvTimer;\r
-LARGE_INTEGER liDueTime;\r
-void *pvObjectList[ 2 ];\r
-const long long ll_ms_In_100ns_units = ( long long ) -1000;\r
-\r
/* Just to prevent compiler warnings. */\r
( void ) lpParameter;\r
\r
- /* The timer is created as a one shot timer even though we want it to repeat\r
- at a given frequency. This is because Windows is not a real time environment,\r
- and attempting to set a high frequency periodic timer will result in event\r
- overruns. Therefore the timer is just reset after each time the pseudo \r
- interrupt handler has processed each tick event. */\r
- pvTimer = CreateWaitableTimer( NULL, TRUE, NULL );\r
- \r
- liDueTime.QuadPart = ( long long ) portTICK_RATE_MS * ll_ms_In_100ns_units;\r
-\r
- /* Block on the timer itself and the event mutex that grants access to the \r
- interrupt variables. */\r
- pvObjectList[ 0 ] = pvInterruptEventMutex;\r
- pvObjectList[ 1 ] = pvTimer;\r
-\r
for(;;)\r
{\r
/* The timer is reset on each itteration of this loop rather than being set\r
to function periodicallys - this is for the reasons stated in the comments\r
where the timer is created. */\r
- vPortTrace( "prvSimulatedPeripheralTimer: Tick acked, setting new tick timer\r\n" );\r
- SetWaitableTimer( pvTimer, &liDueTime, 0, NULL, NULL, TRUE );\r
+ vPortTrace( "prvSimulatedPeripheralTimer: Tick acked, re-Sleeping()\r\n" );\r
\r
/* Wait until the timer expires and we can access the pseudo interrupt \r
variables. */\r
- //WaitForMultipleObjects( ( sizeof( pvObjectList ) / sizeof( void * ) ), pvObjectList, TRUE, INFINITE );\r
- WaitForSingleObject( pvTimer, INFINITE );\r
+ Sleep( portTICK_RATE_MS );\r
+\r
vPortTrace( "prvSimulatedPeripheralTimer: Timer signalled, waiting interrupt event mutex\r\n" );\r
WaitForSingleObject( pvInterruptEventMutex, INFINITE );\r
vPortTrace( "prvSimulatedPeripheralTimer: Got interrupt event mutex\r\n" );\r