X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=Source%2Fportable%2FMSVC-MingW%2Fport.c;h=c50383f9976b9dd6f1bc54d93851a550630ce29a;hb=c7531337cd0c1dc063386fa75fe8fff0a2197e73;hp=6c3727a6ccd232e12eeaaa98735ef9e69189451e;hpb=991ddf48f333176aa532e3399d9fa6d8edf06eb8;p=freertos diff --git a/Source/portable/MSVC-MingW/port.c b/Source/portable/MSVC-MingW/port.c index 6c3727a6c..c50383f99 100644 --- a/Source/portable/MSVC-MingW/port.c +++ b/Source/portable/MSVC-MingW/port.c @@ -1,5 +1,5 @@ /* - FreeRTOS V6.1.0 - Copyright (C) 2010 Real Time Engineers Ltd. + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. *************************************************************************** * * @@ -129,6 +129,8 @@ extern void *pxCurrentTCB; static DWORD WINAPI prvSimulatedPeripheralTimer( LPVOID lpParameter ) { +portTickType xMinimumWindowsBlockTime = ( portTickType ) 20; + /* Just to prevent compiler warnings. */ ( void ) lpParameter; @@ -140,8 +142,15 @@ static DWORD WINAPI prvSimulatedPeripheralTimer( LPVOID lpParameter ) time, not the time that Sleep() is called. It is done this way to prevent overruns in this very non real time simulated/emulated environment. */ - Sleep( portTICK_RATE_MS ); - + if( portTICK_RATE_MS < xMinimumWindowsBlockTime ) + { + Sleep( xMinimumWindowsBlockTime ); + } + else + { + Sleep( portTICK_RATE_MS ); + } + WaitForSingleObject( pvInterruptEventMutex, INFINITE ); /* The timer has expired, generate the simulated tick event. */