Rev 1638 | Rev 1680 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1638 | Rev 1662 | ||
---|---|---|---|
1 | #ifndef _MAIN_H |
1 | #ifndef _MAIN_H |
2 | #define _MAIN_H |
2 | #define _MAIN_H |
3 | 3 | ||
4 | //#define DEBUG // use to activate debug output to MK-Tool: use Debug(text); |
4 | //#define DEBUG // use to activate debug output to MK-Tool: use Debug(text); |
5 | 5 | ||
6 | //#define ACT_S3D_SUMMENSIGNAL |
6 | //#define ACT_S3D_SUMMENSIGNAL |
7 | 7 | ||
8 | // neue Hardware |
8 | // neue Hardware |
9 | #define ROT_OFF {if((PlatinenVersion == 10)||(PlatinenVersion == 20)) PORTB &=~0x01; else PORTB |= 0x01;} |
9 | #define ROT_OFF {if((PlatinenVersion == 10)||(PlatinenVersion >= 20)) PORTB &=~0x01; else PORTB |= 0x01;} |
10 | #define ROT_ON {if((PlatinenVersion == 10)||(PlatinenVersion == 20)) PORTB |= 0x01; else PORTB &=~0x01;} |
10 | #define ROT_ON {if((PlatinenVersion == 10)||(PlatinenVersion >= 20)) PORTB |= 0x01; else PORTB &=~0x01;} |
11 | #define ROT_FLASH PORTB ^= 0x01 |
11 | #define ROT_FLASH PORTB ^= 0x01 |
12 | #define GRN_OFF {if((PlatinenVersion < 12)) PORTB &=~0x02; else PORTB |= 0x02;} |
12 | #define GRN_OFF {if((PlatinenVersion < 12)) PORTB &=~0x02; else PORTB |= 0x02;} |
13 | #define GRN_ON {if((PlatinenVersion < 12)) PORTB |= 0x02; else PORTB &=~0x02;} |
13 | #define GRN_ON {if((PlatinenVersion < 12)) PORTB |= 0x02; else PORTB &=~0x02;} |
14 | #define GRN_FLASH PORTB ^= 0x02 |
14 | #define GRN_FLASH PORTB ^= 0x02 |
15 | 15 | ||
16 | #define SYSCLK F_CPU |
16 | #define SYSCLK F_CPU |
17 | 17 | ||
18 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
18 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
19 | 19 | ||
20 | #define J3High PORTD |= 0x20 |
20 | #define J3High PORTD |= 0x20 |
21 | #define J3Low PORTD &= ~0x20 |
21 | #define J3Low PORTD &= ~0x20 |
22 | #define J4High PORTD |= 0x10 |
22 | #define J4High PORTD |= 0x10 |
23 | #define J4Low PORTD &= ~0x10 |
23 | #define J4Low PORTD &= ~0x10 |
24 | #define J5High PORTD |= 0x08 |
24 | #define J5High PORTD |= 0x08 |
25 | #define J5Low PORTD &= ~0x08 |
25 | #define J5Low PORTD &= ~0x08 |
26 | 26 | ||
27 | extern volatile unsigned char SenderOkay; |
27 | extern volatile unsigned char SenderOkay; |
28 | extern unsigned char BattLowVoltageWarning; |
28 | extern unsigned char BattLowVoltageWarning; |
29 | extern unsigned char CosinusNickWinkel, CosinusRollWinkel; |
29 | extern unsigned char CosinusNickWinkel, CosinusRollWinkel; |
30 | extern unsigned char PlatinenVersion; |
30 | extern unsigned char PlatinenVersion; |
31 | extern unsigned char SendVersionToNavi; |
31 | extern unsigned char SendVersionToNavi; |
32 | 32 | ||
33 | 33 | ||
34 | void LipoDetection(unsigned char print); |
34 | void LipoDetection(unsigned char print); |
35 | extern unsigned int FlugMinuten,FlugMinutenGesamt,FlugSekunden; |
35 | extern unsigned int FlugMinuten,FlugMinutenGesamt,FlugSekunden; |
36 | 36 | ||
37 | #include <stdlib.h> |
37 | #include <stdlib.h> |
38 | #include <string.h> |
38 | #include <string.h> |
39 | #include <avr/io.h> |
39 | #include <avr/io.h> |
40 | #include <avr/pgmspace.h> |
40 | #include <avr/pgmspace.h> |
41 | #include <avr/interrupt.h> |
41 | #include <avr/interrupt.h> |
42 | #include <avr/eeprom.h> |
42 | #include <avr/eeprom.h> |
43 | #include <avr/boot.h> |
43 | #include <avr/boot.h> |
44 | #include <avr/wdt.h> |
44 | #include <avr/wdt.h> |
45 | 45 | ||
46 | 46 | ||
47 | #include "old_macros.h" |
47 | #include "old_macros.h" |
48 | 48 | ||
49 | #include "_Settings.h" |
49 | #include "_Settings.h" |
50 | #include "printf_P.h" |
50 | #include "printf_P.h" |
51 | #include "timer0.h" |
51 | #include "timer0.h" |
52 | #include "uart.h" |
52 | #include "uart.h" |
53 | #include "analog.h" |
53 | #include "analog.h" |
54 | #include "twimaster.h" |
54 | #include "twimaster.h" |
55 | #include "menu.h" |
55 | #include "menu.h" |
56 | #include "rc.h" |
56 | #include "rc.h" |
57 | #include "fc.h" |
57 | #include "fc.h" |
58 | #include "gps.h" |
58 | #include "gps.h" |
59 | #include "spi.h" |
59 | #include "spi.h" |
60 | #include "led.h" |
60 | #include "led.h" |
61 | #include "spektrum.h" |
61 | #include "spektrum.h" |
62 | #include "capacity.h" |
62 | #include "capacity.h" |
63 | #include "eeprom.h" |
63 | #include "eeprom.h" |
64 | #include "libfc.h" |
64 | #include "libfc.h" |
65 | #include "debug.h" |
65 | #include "debug.h" |
66 | 66 | ||
67 | 67 | ||
68 | 68 | ||
69 | #endif //_MAIN_H |
69 | #endif //_MAIN_H |
70 | 70 | ||
71 | 71 | ||
72 | 72 | ||
73 | 73 | ||
74 | 74 | ||
75 | 75 | ||
76 | 76 |