|
|
|
|
|
by jareklupinski
1226 days ago
|
|
A little bit of both. The simplest way that I like use is by creating a seperate function that you want to run asynchronously, then linking it to a callback that is scheduled to run by the FreeRTOS scheduler: https://savjee.be/blog/multitasking-esp32-arduino-freertos/ As long as you don't create too many long-running tasks and be mindful of which core is running what, it's been incredibly reliable in my experience. My biggest use case for this is keeping an active display, like those 64x64 RGB LED Panels, fed with pixel data from a display buffer using one core fully pegged to the task, then using the second core for wifi and display buffer updates. In Arduino land, since loop runs on a specific core, you can basically put your 'constantly running code' in the loop, and schedule the tasks to run on the other core in setup(). |
|