I am developing a CAN-BUS reader (logger) with an ESP32 microcontroller.
This sample uses RTOS and several task to send and receive CAN-BUS messages. https://github.com/espressif/esp-idf/tree/master/examples/peripherals/can/can_self_test
In my application I mostly only want to receive CAN-BUS messages. There will be possibly hundreds of messages to receive within a second. And I want to send maybe every 500ms one single message and this is not time critical.
I wonder if I should follow the example above and have two different tasks for sending and receiving or if I should use just one task and send in that task from time to time that single message. I plan to do that by comparing the current milliseconds with a value which is saved when the last message was sent. If that is more than 500ms ago then send a new message.
I am used to programming for Windows and I have very little experience with the ESP32. The above is my question for my current problem but I think this is a general question when it makes sense to separate tasks and when not.
I searched for an existing answer and I guess there is one but I didn't find it...