Page 1 of 1

vTaskDelay delays way too long

Posted: Mon Jan 08, 2024 6:23 am
by ccut93
I set up a simple "hello world" project to verify functionality of FreeRTOS. My main loop creates a thread with function stillAlive(), which is supposed to print a message every 10ms, but it's actually printing every 1000ms. How do I fix this?
main.c
(492 Bytes) Downloaded 328 times

Re: vTaskDelay delays way too long

Posted: Mon Jan 08, 2024 1:21 pm
by ESP_Sprite
You need to divide by portTICK_PERIOD_MS, not multiply.

Re: vTaskDelay delays way too long

Posted: Mon Jan 08, 2024 1:38 pm
by amitabhs@krishworks
Change your line 9
vTaskDelay(10 / portTICK_PERIOD_MS);