vTaskDelay delays way too long

ccut93
Posts: 1
Joined: Mon Jan 08, 2024 6:04 am

vTaskDelay delays way too long

Postby ccut93 » Mon Jan 08, 2024 6:23 am

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 327 times

ESP_Sprite
Posts: 9730
Joined: Thu Nov 26, 2015 4:08 am

Re: vTaskDelay delays way too long

Postby ESP_Sprite » Mon Jan 08, 2024 1:21 pm

You need to divide by portTICK_PERIOD_MS, not multiply.

amitabhs@krishworks
Posts: 2
Joined: Mon Jan 08, 2024 1:25 pm

Re: vTaskDelay delays way too long

Postby amitabhs@krishworks » Mon Jan 08, 2024 1:38 pm

Change your line 9
vTaskDelay(10 / portTICK_PERIOD_MS);

Who is online

Users browsing this forum: Baidu [Spider], Google [Bot] and 119 guests