Skip to content

Add the ability to enable and disable tasks instead of having to cancel and re-insert #30

@davetcc

Description

@davetcc

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions