Hi,
any opinions on whether it is better to use a task scheduler or RTOS tasks on a dual core ESP32?
I'm thinking of a task that, for example, sends an update every 30 seconds.
I've tried both and both work.
It 'feels' like the RTOS way is better but are there any opinions?
Also, what difference is there between:
xTaskCreatePinnedToCore with tskNO_AFFINITY and
xTaskCreate
It appears that they are the same
Better to use task scheduler or RTOS tasks?
-
- Posts: 9772
- Joined: Thu Nov 26, 2015 4:08 am
Re: Better to use task scheduler or RTOS tasks?
Both work indeed, and it depends on your use case and preference wrt what to use. A (non-pre-emptive multitasking) task scheduler needs the task functions to be written in a specific way, where they always exit at some point. RTOS tasks do not need this, but inter-task communications can be harder and they use some RAM for each tasks stack.
You are right, xTaskCreate actually is an alias for xTaskCreatePinnedToCore with tskNO_AFFINITY.
You are right, xTaskCreate actually is an alias for xTaskCreatePinnedToCore with tskNO_AFFINITY.
Who is online
Users browsing this forum: No registered users and 44 guests