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