]> git.sur5r.net Git - freertos/commitdiff
WIN32 simulator port: Allow the configTICK_RATE_HZ to be increased without making...
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Mon, 14 Feb 2011 13:49:50 +0000 (13:49 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Mon, 14 Feb 2011 13:49:50 +0000 (13:49 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1298 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Source/portable/MSVC-MingW/port.c

index 619fb338b8ee1cc0659758b5fc8eabe510c6549e..c50383f9976b9dd6f1bc54d93851a550630ce29a 100644 (file)
@@ -129,6 +129,8 @@ extern void *pxCurrentTCB;
 \r
 static DWORD WINAPI prvSimulatedPeripheralTimer( LPVOID lpParameter )\r
 {\r
+portTickType xMinimumWindowsBlockTime = ( portTickType ) 20;\r
+\r
        /* Just to prevent compiler warnings. */\r
        ( void ) lpParameter;\r
 \r
@@ -140,8 +142,15 @@ static DWORD WINAPI prvSimulatedPeripheralTimer( LPVOID lpParameter )
                time, not the time that Sleep() is called.  It is done this way to \r
                prevent overruns in this very non real time simulated/emulated \r
                environment. */\r
-               Sleep( portTICK_RATE_MS );\r
-\r
+               if( portTICK_RATE_MS < xMinimumWindowsBlockTime )\r
+               {\r
+                       Sleep( xMinimumWindowsBlockTime );\r
+               }\r
+               else\r
+               {\r
+                       Sleep( portTICK_RATE_MS );\r
+               }\r
+       \r
                WaitForSingleObject( pvInterruptEventMutex, INFINITE );\r
 \r
                /* The timer has expired, generate the simulated tick event. */\r