How to Implement a 6-Hour Delay in FreeRTOS Task?

I would like to know if i can do vtaskdelay of a period of 6 hours, what is the way to do it.
I have a task I wanted to be excuted eeach 6 hours whats is the best way to do it .?

Thanks
Solution
@youcef_ali
vTaskDelay
takes the delay period in ticks, you need to convert the 6 hours into ticks based on your system's tick rate. Normally, u'll are to multiply the number of seconds in 6hours with your ticks per second which would result in a very high number and using large value isn't ideal so a better approach would be using a loop i.e πŸ‘‡ (this is assuming ur tick is 1000/sec)
#define HOUR_TICKS (3600000)  // 1 hour in ticks

void vTaskFunction(void *pvParameters)
{
    for (;;)
    {
        // Perform your task here
        
   
        for (int i = 0; i < 6; i++)
        {
            vTaskDelay(HOUR_TICKS);
        }
    }
}
Was this page helpful?