diff options
Diffstat (limited to 'core/cortex-m0/task.c')
-rw-r--r-- | core/cortex-m0/task.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/cortex-m0/task.c b/core/cortex-m0/task.c index 32dabcaf19..1fa6032fec 100644 --- a/core/cortex-m0/task.c +++ b/core/cortex-m0/task.c @@ -433,6 +433,19 @@ void task_enable_all_tasks(void) __schedule(0, 0); } +void task_enable_task(task_id_t tskid) +{ + atomic_or(&tasks_enabled, BIT(tskid)); +} + +void task_disable_task(task_id_t tskid) +{ + atomic_clear(&tasks_enabled, BIT(tskid)); + + if (!in_interrupt_context() && tskid == task_get_current()) + __schedule(0, 0); +} + void task_enable_irq(int irq) { CPU_NVIC_EN(0) = 1 << irq; |