Add the following two new methods to taskManager:
void enableTask(taskid_t taskId, boolean taskEnabled);
boolean isTaskEnabled(taskid_t taskId);
We'll have a new status flag for enabled, I've checked and there are enough spare bits in the current execution mode status flag to deal with this.
- On enable, the task will be put back into the running list and the next scheduled time calculated. This means that the task would continue as normal.
- On disable, the flag would be set to mark it as such, it would then not even need to be removed from the queue, calling execute would do nothing, and it would not repeat.
- This would not apply to events, as they are often triggered from interrupts, and the user has complete control over when events execute anyway. It would apply to functional and OO (executable) tasks.