summaryrefslogtreecommitdiff
path: root/ao_task.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2009-04-14 10:02:19 -0700
committerKeith Packard <keithp@keithp.com>2009-04-14 10:02:19 -0700
commitfb63262699d3a6fbf347d24efda8b01f75b7d0d3 (patch)
tree16909e9dee01b2939dd66ff1b8e80a70c2aace0f /ao_task.c
parent7e4abf3a40c39d0ce4f466281bef9a464df85dd4 (diff)
Add comments, clean up white space, etc.
Various clean ups now that the basic code appears to work. Signed-off-by: Keith Packard <keithp@keithp.com>
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();
}