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