summaryrefslogtreecommitdiff
path: root/ao_task.c
diff options
context:
space:
mode:
Diffstat (limited to 'ao_task.c')
-rw-r--r--ao_task.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ao_task.c b/ao_task.c
index d03fa02a..24bd319a 100644
--- a/ao_task.c
+++ b/ao_task.c
@@ -29,7 +29,7 @@ ao_add_task(__xdata struct ao_task * task, void (*start)(void))
{
uint8_t __xdata *stack;
if (ao_num_tasks == AO_NUM_TASKS)
- ao_panic(AO_ERROR_NO_TASK);
+ ao_panic(AO_PANIC_NO_TASK);
ao_tasks[ao_num_tasks++] = task;
/*
* Construct a stack frame so that it will 'return'
@@ -162,7 +162,9 @@ ao_yield(void) _naked
int
ao_sleep(__xdata void *wchan)
{
+ ao_interrupt_disable();
ao_cur_task->wchan = wchan;
+ ao_interrupt_enable();
ao_yield();
}