Cyclic CAN messages inside one task


I would like to transmit cyclic CAN messages from one task. Some messages will be sent in 50 ms cycle, some in 100 ms and so on.
I would like to know if FreeRTOS has something that could help me achieve this. My idea is to count ticks. Each message has timeout and block field. If block == tick, message is transmitted and block field is updated with tick + timeout. This might work but I am not sure if it is a right way to do it. Maybe FreeRTOS has something more effective.

Thank you in advance.

You might want to look at timers, and let the timer callback function activate a message to be sent. Timers can cause a callback to be called at a specified period.

The one thing to remember is that the callback function shouldn’t do anything that takes a lot of time or that might block, so often it just queues up something or notifies a task to do something.