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