Win32 - pdMS_TO_TICKS definition

roujesky1 wrote on Monday, November 04, 2019:

I am running the example Win32 sample as a proof of concept test. I am familiar with FreeRTOS on a Microchip. It seems a shame to only have sleep resolution of 1ms on a multicore processor running almost 2ghz, so I put the following code in FreeRTOSConfig.h. Note that i change the divisor from 1000 to 10000:

#define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( TickType_t ) ( xTimeInMs ) * ( TickType_t ) configTICK_RATE_HZ ) / ( TickType_t ) 10000 ) )

when I call
vTaskDelay(1);
I should now only delay 100 microseconds rather than the default 1 millisecond,right? Is this the correct way of doing this? Are there any nasty subtle side-effecsts to doing this
Is there a way to test this without using a digital out on a scope? Right now, I dont have my board yet and testing on my laptop.

thanks!

rtel wrote on Monday, November 04, 2019:

Hi - be aware that you are not going to get real time behaviour from
Windows - just an approximation as ultimately Windows decides when to
schedule the threads in which the FreeRTOs tasks are running.

roujesky1 wrote on Tuesday, November 05, 2019:

Got it, thanks!!!