Rev 1775 | Rev 1801 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1775 | Rev 1796 | ||
---|---|---|---|
1 | #ifndef _OUTPUT_H |
1 | #ifndef _OUTPUT_H |
2 | #define _OUTPUT_H |
2 | #define _OUTPUT_H |
3 | 3 | ||
4 | #include <avr/io.h> |
4 | #include <avr/io.h> |
5 | 5 | ||
6 | // This is for LEDs connected directly between +5V and the AVR port, without transistors. |
6 | // This is for LEDs connected directly between +5V and the AVR port, without transistors. |
7 | // PORTbit = 0 --> LED on. |
7 | // PORTbit = 0 --> LED on. |
8 | // To use the normal transistor set-up where 1 --> transistor conductive, reverse the |
8 | // To use the normal transistor set-up where 1 --> transistor conductive, reverse the |
9 | // ON and OFF statements. |
9 | // ON and OFF statements. |
10 | #define OUTPUT_ON(num) {PORTC |= (4 << (num));} |
10 | #define OUTPUT_ON(num) {PORTC |= (4 << (num));} |
11 | #define OUTPUT_OFF(num) {PORTC &= ~(4 << (num));} |
11 | #define OUTPUT_OFF(num) {PORTC &= ~(4 << (num));} |
12 | #define OUTPUT_SET(num, state) {if ((state)) OUTPUT_ON(num) else OUTPUT_OFF(num)} |
12 | #define OUTPUT_SET(num, state) {if ((state)) OUTPUT_ON(num) else OUTPUT_OFF(num)} |
13 | #define OUTPUT_TOGGLE(num) ( {PORTC ^= (4 << (num));} |
13 | #define OUTPUT_TOGGLE(num) ( {PORTC ^= (4 << (num));} |
14 | 14 | ||
15 | #define DEBUG_LEDTEST 256 |
15 | #define DEBUG_LEDTEST 256 |
16 | #define DEBUG_HEIGHT_SWITCH 1 |
16 | #define DEBUG_HEIGHT_SWITCH 1 |
17 | #define DEBUG_HEIGHT_DIFF 2 |
17 | #define DEBUG_HEIGHT_DIFF 2 |
18 | #define DEBUG_HOVERTHROTTLE 4 |
18 | #define DEBUG_HOVERTHROTTLE 4 |
19 | #define DEBUG_ACC0THORDER 8 |
19 | #define DEBUG_ACC0THORDER 8 |
20 | #define DEBUG_COMMANDREPEATED 16 |
20 | #define DEBUG_COMMANDREPEATED 16 |
- | 21 | #define DEBUG_PRESSURERANGE 32 |
|
21 | 22 | ||
22 | void output_init(void); |
23 | void output_init(void); |
23 | void output_update(void); |
24 | void output_update(void); |
24 | 25 | ||
25 | #endif //_output_H |
26 | #endif //_output_H |
26 | 27 |