1 # 1 "/home/zer0/zavr/projects/microb2010/tests/static_beacon/static_beacon.c"
2 # 1 "/home/zer0/zavr/projects/microb2010/tests/static_beacon//"
5 # 1 "/home/zer0/zavr/projects/microb2010/tests/static_beacon/static_beacon.c"
6 # 23 "/home/zer0/zavr/projects/microb2010/tests/static_beacon/static_beacon.c"
7 # 1 "/home/zer0/zavr/include/aversive.h" 1
8 # 31 "/home/zer0/zavr/include/aversive.h"
10 # 32 "/home/zer0/zavr/include/aversive.h" 2
13 # 1 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/avr/interrupt.h" 1 3
14 # 38 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/avr/interrupt.h" 3
15 # 1 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/avr/io.h" 1 3
16 # 94 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/avr/io.h" 3
17 # 1 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/avr/sfr_defs.h" 1 3
18 # 126 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/avr/sfr_defs.h" 3
19 # 1 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/inttypes.h" 1 3
20 # 37 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/inttypes.h" 3
21 # 1 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/stdint.h" 1 3
22 # 121 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/stdint.h" 3
23 typedef int int8_t __attribute__((__mode__(__QI__)));
24 typedef unsigned int uint8_t __attribute__((__mode__(__QI__)));
25 typedef int int16_t __attribute__ ((__mode__ (__HI__)));
26 typedef unsigned int uint16_t __attribute__ ((__mode__ (__HI__)));
27 typedef int int32_t __attribute__ ((__mode__ (__SI__)));
28 typedef unsigned int uint32_t __attribute__ ((__mode__ (__SI__)));
30 typedef int int64_t __attribute__((__mode__(__DI__)));
31 typedef unsigned int uint64_t __attribute__((__mode__(__DI__)));
32 # 142 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/stdint.h" 3
33 typedef int16_t intptr_t;
38 typedef uint16_t uintptr_t;
39 # 159 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/stdint.h" 3
40 typedef int8_t int_least8_t;
45 typedef uint8_t uint_least8_t;
50 typedef int16_t int_least16_t;
55 typedef uint16_t uint_least16_t;
60 typedef int32_t int_least32_t;
65 typedef uint32_t uint_least32_t;
73 typedef int64_t int_least64_t;
80 typedef uint64_t uint_least64_t;
81 # 213 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/stdint.h" 3
82 typedef int8_t int_fast8_t;
87 typedef uint8_t uint_fast8_t;
92 typedef int16_t int_fast16_t;
97 typedef uint16_t uint_fast16_t;
102 typedef int32_t int_fast32_t;
107 typedef uint32_t uint_fast32_t;
115 typedef int64_t int_fast64_t;
122 typedef uint64_t uint_fast64_t;
123 # 273 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/stdint.h" 3
124 typedef int64_t intmax_t;
129 typedef uint64_t uintmax_t;
130 # 38 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/inttypes.h" 2 3
131 # 77 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/inttypes.h" 3
132 typedef int32_t int_farptr_t;
136 typedef uint32_t uint_farptr_t;
137 # 127 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/avr/sfr_defs.h" 2 3
138 # 95 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/avr/io.h" 2 3
139 # 229 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/avr/io.h" 3
140 # 1 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/avr/iom8.h" 1 3
141 # 230 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/avr/io.h" 2 3
142 # 317 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/avr/io.h" 3
143 # 1 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/avr/portpins.h" 1 3
144 # 318 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/avr/io.h" 2 3
146 # 1 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/avr/common.h" 1 3
147 # 320 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/avr/io.h" 2 3
149 # 1 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/avr/version.h" 1 3
150 # 322 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/avr/io.h" 2 3
153 # 1 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/avr/fuse.h" 1 3
154 # 223 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/avr/fuse.h" 3
160 # 325 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/avr/io.h" 2 3
163 # 1 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/avr/lock.h" 1 3
164 # 328 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/avr/io.h" 2 3
165 # 39 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/avr/interrupt.h" 2 3
166 # 35 "/home/zer0/zavr/include/aversive.h" 2
170 # 1 "/home/zer0/zavr/include/aversive/types.h" 1
171 # 47 "/home/zer0/zavr/include/aversive/types.h"
173 typedef uint16_t u16;
174 typedef uint32_t u32;
175 typedef uint64_t u64;
180 # 39 "/home/zer0/zavr/include/aversive.h" 2
181 # 1 "/home/zer0/zavr/include/aversive/errno.h" 1
182 # 33 "/home/zer0/zavr/include/aversive/errno.h"
183 # 1 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/errno.h" 1 3
184 # 55 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/errno.h" 3
186 # 34 "/home/zer0/zavr/include/aversive/errno.h" 2
187 # 40 "/home/zer0/zavr/include/aversive.h" 2
188 # 1 "/home/zer0/zavr/include/aversive/irq_lock.h" 1
189 # 41 "/home/zer0/zavr/include/aversive.h" 2
190 # 125 "/home/zer0/zavr/include/aversive.h"
205 } __attribute__ ((packed)) u8;
214 } __attribute__ ((packed)) u16;
225 } __attribute__ ((packed)) u16_b;
227 } __attribute__ ((packed)) u;
228 } __attribute__ ((packed));
229 # 174 "/home/zer0/zavr/include/aversive.h"
240 } __attribute__ ((packed)) u8;
242 } __attribute__ ((packed)) u;
243 } __attribute__ ((packed));
244 # 24 "/home/zer0/zavr/projects/microb2010/tests/static_beacon/static_beacon.c" 2
245 # 1 "/home/zer0/zavr/include/aversive/wait.h" 1
246 # 45 "/home/zer0/zavr/include/aversive/wait.h"
247 # 1 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/util/delay.h" 1 3
248 # 39 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/util/delay.h" 3
249 # 1 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/util/delay_basic.h" 1 3
250 # 65 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/util/delay_basic.h" 3
251 static inline void _delay_loop_1(uint8_t __count) __attribute__((always_inline));
252 static inline void _delay_loop_2(uint16_t __count) __attribute__((always_inline));
253 # 80 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/util/delay_basic.h" 3
255 _delay_loop_1(uint8_t __count)
264 # 102 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/util/delay_basic.h" 3
266 _delay_loop_2(uint16_t __count)
269 "1: sbiw %0,1" "\n\t"
275 # 40 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/util/delay.h" 2 3
276 # 79 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/util/delay.h" 3
277 static inline void _delay_us(double __us) __attribute__((always_inline));
278 static inline void _delay_ms(double __ms) __attribute__((always_inline));
279 # 107 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/util/delay.h" 3
281 _delay_us(double __us)
284 double __tmp = ((((unsigned long)(16000000))) / 3e6) * __us;
287 else if (__tmp > 255)
289 _delay_ms(__us / 1000.0);
293 __ticks = (uint8_t)__tmp;
294 _delay_loop_1(__ticks);
296 # 141 "/usr/lib/gcc/avr/4.3.2/../../../avr/include/util/delay.h" 3
298 _delay_ms(double __ms)
301 double __tmp = ((((unsigned long)(16000000))) / 4e3) * __ms;
304 else if (__tmp > 65535)
307 __ticks = (uint16_t) (__ms * 10.0);
311 _delay_loop_2(((((unsigned long)(16000000))) / 4e3) / 10);
317 __ticks = (uint16_t)__tmp;
318 _delay_loop_2(__ticks);
320 # 46 "/home/zer0/zavr/include/aversive/wait.h" 2
321 # 59 "/home/zer0/zavr/include/aversive/wait.h"
322 static inline void wait_ms(uint16_t n)
325 _delay_loop_2(((unsigned long)(16000000))/4000);
327 # 25 "/home/zer0/zavr/projects/microb2010/tests/static_beacon/static_beacon.c" 2
328 # 100 "/home/zer0/zavr/projects/microb2010/tests/static_beacon/static_beacon.c"
329 static inline void xmit_0(void)
331 uint8_t t = (((17 + 17) * 10) / 3);
332 (*(volatile uint8_t *)((0x2E) + 0x20)) = 0;
333 (*(volatile uint8_t *)((0x2F) + 0x20)) = 0;
337 static inline void xmit_1(void)
339 uint8_t t = (((17 + 17) * 10) / 3);
340 (*(volatile uint8_t *)((0x2E) + 0x20)) = (1 << (4)) | (1 << (3));
341 (*(volatile uint16_t *)((0x2C) + 0x20)) = (17 + 17)-1;
342 (*(volatile uint8_t *)((0x2F) + 0x20)) = (1 << (7)) | (1 << (1));
343 (*(volatile uint8_t *)((0x2E) + 0x20)) = (1 << (4)) | (1 << (3)) | (1 << (0));
349 static inline void xmit_manchester_0(void)
355 static inline void xmit_manchester_1(void)
363 static void xmit_bits(uint8_t *buf, uint8_t nbit)
368 for (i=0; i<nbit; i++) {
378 if (((i & 0x07) == 0) && (i != 0))
385 static inline int8_t wait_laser(void)
392 while (((*(volatile uint8_t *)((0x13) + 0x20)) & ((1 << (0)) | (1 << (1)))) != ((1 << (0)) | (1 << (1))));
395 while ((photos = ((*(volatile uint8_t *)((0x13) + 0x20)) & ((1 << (0)) | (1 << (1))))) == ((1 << (0)) | (1 << (1))));
397 if (photos != ((1 << (1))))
399 time = (*(volatile uint8_t *)((0x32) + 0x20));
400 ( (*(volatile uint8_t *)((0x12) + 0x20)) |= (1 << (5)));
403 while ((photos = ((*(volatile uint8_t *)((0x13) + 0x20)) & ((1 << (0)) | (1 << (1))))) == ((1 << (1)))) {
404 if ((*(volatile uint8_t *)((0x32) + 0x20)) - time > ((uint8_t)25))
407 if (photos != ((1 << (0)) | (1 << (1))))
412 while ((photos = ((*(volatile uint8_t *)((0x13) + 0x20)) & ((1 << (0)) | (1 << (1))))) == ((1 << (0)) | (1 << (1)))) {
413 if ((*(volatile uint8_t *)((0x32) + 0x20)) - time > ((uint8_t)250))
416 ( (*(volatile uint8_t *)((0x12) + 0x20)) |= (1 << (6)));
417 if ((*(volatile uint8_t *)((0x32) + 0x20)) - time < ((uint8_t)0))
419 if (photos != ((1 << (0))))
421 # 206 "/home/zer0/zavr/projects/microb2010/tests/static_beacon/static_beacon.c"
430 uint8_t frame = 0x0B;
434 (*(volatile uint8_t *)((0x11) + 0x20)) = (1 << (5)) | (1 << (6)) | (1 << (7));
435 (*(volatile uint8_t *)((0x17) + 0x20)) |= (1 << (1));
436 # 240 "/home/zer0/zavr/projects/microb2010/tests/static_beacon/static_beacon.c"
437 (*(volatile uint16_t *)((0x26) + 0x20)) = (17 + 17);
438 (*(volatile uint16_t *)((0x2A) + 0x20)) = 17;
439 (*(volatile uint8_t *)((0x2F) + 0x20)) = (1 << (7)) | (1 << (1));
440 (*(volatile uint8_t *)((0x2E) + 0x20)) = (1 << (4)) | (1 << (3));
443 (*(volatile uint8_t *)((0x33) + 0x20)) = (1 << (1)) | (1 << (0));
450 ( (*(volatile uint8_t *)((0x12) + 0x20)) &= ~ (1 << (5)));
451 ( (*(volatile uint8_t *)((0x12) + 0x20)) &= ~ (1 << (6)));
458 ( (*(volatile uint8_t *)((0x12) + 0x20)) |= (1 << (7)));
460 xmit_bits(&frame, 4);
464 ( (*(volatile uint8_t *)((0x12) + 0x20)) &= ~ (1 << (7)));