Wed, 16 Nov 2011 17:04:10 +0100
added receiver testing stuff
9 | 1 | #ifndef MAIN_H |
2 | #define MAIN_H | |
3 | ||
4 | #include <avr/wdt.h> | |
5 | ||
6 | #define uchar unsigned char | |
7 | #define uint unsigned int | |
8 | ||
9 | // Macro used to write to a single I/O pin | |
10 | #define writeBit(port,bit,value) { if ((value)>0) (port) |= (1<<bit); else (port) &= ~(1<<bit); } | |
11 | ||
12 | // Macro used to read from a single I/O pin | |
13 | #define readBit(port,bit) (((port) >> (bit)) & 1) | |
14 | ||
15 | // we have internal AREF... | |
16 | // #define EXT_AREF 1 | |
17 | ||
18 | // RESET ROUTINE FOR DOING A SOFT-RESET: | |
19 | #define soft_reset() \ | |
20 | do \ | |
21 | { \ | |
22 | wdt_enable(WDTO_15MS); \ | |
23 | for(;;) \ | |
24 | { \ | |
25 | } \ | |
26 | } while(0) | |
27 | ||
28 | ||
29 | #endif |