From: richardbarry Date: Mon, 14 Feb 2011 13:49:50 +0000 (+0000) Subject: WIN32 simulator port: Allow the configTICK_RATE_HZ to be increased without making... X-Git-Tag: V7.0.0~51 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c7531337cd0c1dc063386fa75fe8fff0a2197e73;p=freertos WIN32 simulator port: Allow the configTICK_RATE_HZ to be increased without making the sleep time in the simulated timer peripheral too small. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1298 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/Source/portable/MSVC-MingW/port.c b/Source/portable/MSVC-MingW/port.c index 619fb338b..c50383f99 100644 --- a/Source/portable/MSVC-MingW/port.c +++ b/Source/portable/MSVC-MingW/port.c @@ -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. */