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