2 * Copyright © 2011 Keith Packard <keithp@keithp.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
23 #include <avr/interrupt.h>
24 #include <avr/sleep.h>
26 #define F_CPU 8000000UL // 8 MHz
29 * AVR definitions and code fragments for AltOS
32 #define AO_STACK_SIZE 116
34 /* Various definitions to make GCC look more like SDCC */
36 #define ao_arch_naked_declare __attribute__((naked))
37 #define ao_arch_naked_define
44 #define __interrupt(n)
47 #define ao_arch_reboot() /* XXX */
49 #define ao_arch_nop() asm("nop")
51 #define ao_arch_interrupt(n) /* nothing */
55 #define putchar(c) ao_putchar(c)
56 #define getchar ao_getchar
58 #define ao_arch_wait_interrupt() do { \
65 #define ao_arch_critical(b) do { cli(); do { b } while (0); sei(); } while (0)
67 #define ao_arch_block_interrupts() cli()
68 #define ao_arch_release_interrupts() sei()
70 #define ao_mutex_get(m)
71 #define ao_mutex_put(m)
74 ao_delay_until(uint16_t target);
76 /* We can't hit 100 Hz, but we can hit 125 */
80 ao_eeprom_read(uint16_t addr, void *buf, uint16_t len);
83 ao_eeprom_write(uint16_t addr, void *buf, uint16_t len);
85 #endif /* _AO_ARCH_H_ */