diff options
Diffstat (limited to 'core/nds32')
-rw-r--r-- | core/nds32/task.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/nds32/task.c b/core/nds32/task.c index 66d922504d..389b20ba38 100644 --- a/core/nds32/task.c +++ b/core/nds32/task.c @@ -549,6 +549,19 @@ void task_enable_all_tasks(void) __schedule(0, 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, 0); +} + void __ram_code task_enable_irq(int irq) { uint32_t int_mask = get_int_mask(); |