Arduino has a scheduler that is simplistic (yet easy to learn and easy to teach) task scheduler that could be easily be implemented as a wrapper around the chipKIT-core task manager. The two functions:
What I'm unsure of is that the chipKIT tasks pass parameters to the task callback. The Arduino tasks to not take parameters. This may require making a new taskFuncArduino type to support this parameter-less callback.
typedef void (*taskFuncArduino)();
If this is done then the task manager would need to detect the pointer type.
Arduino has a scheduler that is simplistic (yet easy to learn and easy to teach) task scheduler that could be easily be implemented as a wrapper around the chipKIT-core task manager. The two functions:
startLoop() yield()
Suggested wrappers: uint32_t dummy_task_var; startLoop(taskFunc task) { createTask(task, 0, TASK_ENABLE, &dummy_task_var); } yield() { delay(0); }
What I'm unsure of is that the chipKIT tasks pass parameters to the task callback. The Arduino tasks to not take parameters. This may require making a new taskFuncArduino type to support this parameter-less callback.
typedef void (*taskFuncArduino)();
If this is done then the task manager would need to detect the pointer type.
https://www.arduino.cc/en/Reference/Scheduler