1 AltOS - 8051 operating system for Altus-Metrum projects
5 Copyright © 2009 Keith Packard <keithp@keithp.com>
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; version 2 of the License.
11 This program is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License along
17 with this program; if not, write to the Free Software Foundation, Inc.,
18 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
24 * Unix-style sleep/wakeup scheduling
25 * Strict round-robin, no priorities
29 void ao_sleep(void *wchan)
31 Puts current task to sleep. Will wake up when wchan is signalled
33 void ao_wakeup(void *wchan)
35 Wakeup all tasks sleeping on wchan
37 void ao_add_task(struct ao_task *task, void (*start)(void))
39 Adds a task to the queue of available tasks
41 void ao_start_scheduler(void)
43 Invokes the scheduler, starting the operating system
47 Switches to another task which is ready to run. Allows
48 tasks which want to run for a while to give up the CPU
49 without needing to sleep
51 void ao_panic(uint8_t reason)
53 Any fatal error should call this function, which can
54 display the error code in some cryptic fashion.