Rev 942 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 942 | Rev 943 | ||
---|---|---|---|
1 | #ifndef _MAIN_H |
1 | #ifndef _MAIN_H |
2 | #define _MAIN_H |
2 | #define _MAIN_H |
3 | 3 | ||
4 | #include <avr/io.h> |
4 | #include <avr/io.h> |
5 | 5 | ||
6 | //set crystal frequency here |
6 | //set crystal frequency here |
7 | #if defined (__AVR_ATmega644__) |
7 | #if defined (__AVR_ATmega644__) |
8 | #define SYSCLK 20000000L //crystal freqency in Hz |
8 | #define SYSCLK 20000000L //crystal freqency in Hz |
9 | #endif |
9 | #endif |
10 | 10 | ||
11 | #if defined (__AVR_ATmega644P__) |
11 | #if defined (__AVR_ATmega644P__) |
12 | #define SYSCLK 20000000L //crystal freqency in Hz |
12 | #define SYSCLK 20000000L //crystal freqency in Hz |
13 | #endif |
13 | #endif |
14 | 14 | ||
15 | #define F_CPU SYSCLK |
15 | #define F_CPU SYSCLK |
- | 16 | ||
- | 17 | #ifdef HEXAKOPTER |
|
- | 18 | #define MOTOR_COUNT 6 |
|
- | 19 | #else |
|
- | 20 | #define MOTOR_COUNT 4 |
|
16 | 21 | #endif |
|
17 | 22 | ||
18 | // neue Hardware |
23 | // neue Hardware |
19 | #define RED_OFF {if(BoardRelease == 10) PORTB &=~(1<<PORTB0); else PORTB |= (1<<PORTB0);} |
24 | #define RED_OFF {if(BoardRelease == 10) PORTB &=~(1<<PORTB0); else PORTB |= (1<<PORTB0);} |
20 | #define RED_ON {if(BoardRelease == 10) PORTB |= (1<<PORTB0); else PORTB &=~(1<<PORTB0);} |
25 | #define RED_ON {if(BoardRelease == 10) PORTB |= (1<<PORTB0); else PORTB &=~(1<<PORTB0);} |
21 | #define RED_FLASH PORTB ^= (1<<PORTB0) |
26 | #define RED_FLASH PORTB ^= (1<<PORTB0) |
22 | #define GRN_OFF {if(BoardRelease < 12) PORTB &=~(1<<PORTB1); else PORTB |= (1<<PORTB1);} |
27 | #define GRN_OFF {if(BoardRelease < 12) PORTB &=~(1<<PORTB1); else PORTB |= (1<<PORTB1);} |
23 | #define GRN_ON {if(BoardRelease < 12) PORTB |= (1<<PORTB1); else PORTB &=~(1<<PORTB1);} |
28 | #define GRN_ON {if(BoardRelease < 12) PORTB |= (1<<PORTB1); else PORTB &=~(1<<PORTB1);} |
24 | #define GRN_FLASH PORTB ^= (1<<PORTB1) |
29 | #define GRN_FLASH PORTB ^= (1<<PORTB1) |
25 | 30 | ||
26 | #include <inttypes.h> |
31 | #include <inttypes.h> |
27 | 32 | ||
28 | extern uint8_t BoardRelease; |
33 | extern uint8_t BoardRelease; |
29 | 34 | ||
30 | #endif //_MAIN_H |
35 | #endif //_MAIN_H |
31 | 36 | ||
32 | 37 | ||
33 | 38 | ||
34 | 39 | ||
35 | 40 | ||
36 | 41 | ||
37 | 42 |