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