*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
{
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'
int
ao_sleep(__xdata void *wchan)
{
+ ao_interrupt_disable();
ao_cur_task->wchan = wchan;
+ ao_interrupt_enable();
ao_yield();
}
void
ao_start_scheduler(void)
{
+ ao_timer_init();
+ ao_adc_init();
+ ao_beep_init();
+ ao_led_init();
+ ao_usb_init();
+
ao_cur_task_id = AO_NO_TASK;
ao_cur_task = NULL;
ao_yield();