Update TODO list
[trut64.git] / avr / avrlibc162.h
blobf6df29f57c06d6d7023c556f0060ada2dfd1a5b2
1 /*
2 * Copyright (C) 2007 Anton Blad
3 * Copyright (C) 2007 Fredrik Kuivinen
4 * Copyright (C) 2007 Jakob Rosén
6 * This file is licensed under GPL v2.
7 */
9 #ifndef AVRLIBC162_H
10 #define AVRLIBC162_H
12 #include <avr/io.h>
14 /* avrlibc does not yet include complete support for at90usb162. The lacking
15 functionality is defined in this file. */
17 #if __AVR_LIBC_VERSION__ < 10600ul
18 typedef enum
20 clock_div_1 = 0,
21 clock_div_2 = 1,
22 clock_div_4 = 2,
23 clock_div_8 = 3,
24 clock_div_16 = 4,
25 clock_div_32 = 5,
26 clock_div_64 = 6,
27 clock_div_128 = 7,
28 clock_div_256 = 8
29 } clock_div_t;
31 #define clock_prescale_set(x) \
32 { \
33 uint8_t tmp = _BV(CLKPCE); \
34 __asm__ __volatile__ ( \
35 "in __tmp_reg__,__SREG__" "\n\t" \
36 "cli" "\n\t" \
37 "sts %1, %0" "\n\t" \
38 "sts %1, %2" "\n\t" \
39 "out __SREG__, __tmp_reg__" \
40 : /* no outputs */ \
41 : "d" (tmp), \
42 "M" (_SFR_MEM_ADDR(CLKPR)), \
43 "d" (x) \
44 : "r0"); \
46 #endif
48 #endif