]> git.sur5r.net Git - freertos/blobdiff - Source/portable/MSVC-MingW/port.c
WIN32 simulator port: Allow the configTICK_RATE_HZ to be increased without making...
[freertos] / Source / portable / MSVC-MingW / port.c
index 6c3727a6ccd232e12eeaaa98735ef9e69189451e..c50383f9976b9dd6f1bc54d93851a550630ce29a 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V6.1.0 - Copyright (C) 2010 Real Time Engineers Ltd.\r
+    FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd.\r
 \r
     ***************************************************************************\r
     *                                                                         *\r
@@ -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