Currently I have configured “configTICK_RATE_HZ” parameter in FreeRTOSConfig.h to be 1000.
I want to change this parameter to 250.
There are vTaskDelay()s and xTicksToWait defined in my code.
Is it possible to achieve the same delay miliseconds I achieved with Tick rate 1000 in Tick rate 250,
without changing the figures i used at vTaskDelay()s and xTicksToWaits?
If you wrote the delays as plain numbers, no. The key to making these delays “constant” over varying tick rates is to compute the value based on configTICK_RATE_HZ like vTaskDelay(delayms * configTICK_RATE_HZ/1000)
I tend to define a macro to do the conversion and use it on all delays that are specified in ticks, so that I can specify them in ms and not need to worry if I adjust the tick rate.
There is one hack you could do if this is too much work to do it right, and that is change the tick interrupt to call the tick increment routine 4 times.
If these are defined in terms of portTICK_RATE_MS, defined in portmacro.h, then timings will still be correct.
If not they won’t, but it should be worth changing the definitions from (say) counts (in ticks) to delay_ms / portTICK_RATE_MS. If these are all constants, the compiler will work them out.
Then changing configTICK_RATE_HZ will not effect the delay period as portTICK_RATE_MS will be adjusted automatically.
There are lots and lots and lots of examples of this in the set of standard demo tasks that are used in all the demo applications included in the FreeRTOS download.