Subversion Repositories FlightCtrl

Rev

Rev 2176 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2176 Rev 2177
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
 
-
 
10
 
-
 
11
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))        ///MartinW
-
 
12
        #define WITH_MKTOOL_Display
-
 
13
        #define WITH_JETI_SIMULATION
-
 
14
        #define WITH_ExternControl
-
 
15
        #define WITH_ACC_Loop
-
 
16
        #define WITH_FULL_ANALOG_TEXT
-
 
17
        #define WITHSPECTRUM
-
 
18
        //#define WITH_REMAINCAPACITY // MartinR: entfernt, da Konflikt mit Libfc
-
 
19
//      #define WITH_PANOTRIGGER // MartinR: entfernt
-
 
20
#else
-
 
21
#endif
-
 
22
 
-
 
23
 
-
 
24
//#define WITH_MKTOOL_Display                   /// MartinW;  with MKTool Display 70604-63130
-
 
25
//#define WITHSPECTRUM                                  /// MartinW;  memsave
-
 
26
//#define WITH_FULL_ANALOG_TEXT                 /// MartinW;  memsave // MartinR: deaktiviert
-
 
27
//#define WITH_ExternControl                    /// MartinW;  memsave // MartinR: deaktiviert
-
 
28
//#define WITH_ORIGINAL_MOTORSMOOTHING  /// MartinW;  memsave 63312-63164
-
 
29
//#define WITH_JETI_SIMULATION                  /// MartinW;  memsave 63312-63016 // MartinR: deaktiviert
-
 
30
//#define WITH_JETI_BEEP                                        /// MartinW;  63072-63038; 63216-63050 // MartinR: deaktiviert
-
 
31
//#define WITH_PANOTRIGGER                              /// MartinW;  64336-64112
-
 
32
//#define WITH_HOTTMENU                                 /// Metro;  // MartinR: deaktiviert
-
 
33
//#define WITH_REMAINCAPACITY                   /// Metro;
-
 
34
 
-
 
35
 
-
 
36
 
-
 
37
 
-
 
38
 
-
 
39
 
9
 
40
 
10
// neue Hardware
41
// neue Hardware
11
#define ROT_OFF   {if((PlatinenVersion == 10)||(PlatinenVersion >= 20)) PORTB &=~0x01; else  PORTB |= 0x01;}
42
#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;}
43
#define ROT_ON    {if((PlatinenVersion == 10)||(PlatinenVersion >= 20)) PORTB |= 0x01; else  PORTB &=~0x01;}
13
#define ROT_FLASH PORTB ^= 0x01
44
#define ROT_FLASH PORTB ^= 0x01
14
#define GRN_OFF   {if((PlatinenVersion < 12)) PORTB &=~0x02; else PORTB |= 0x02;}
45
#define GRN_OFF   {if((PlatinenVersion < 12)) PORTB &=~0x02; else PORTB |= 0x02;}
15
#define GRN_ON    {if((PlatinenVersion < 12)) PORTB |= 0x02; else PORTB &=~0x02;}
46
#define GRN_ON    {if((PlatinenVersion < 12)) PORTB |= 0x02; else PORTB &=~0x02;}
16
#define GRN_FLASH PORTB ^= 0x02
47
#define GRN_FLASH PORTB ^= 0x02
17
 
48
 
18
#define SYSCLK F_CPU
49
#define SYSCLK F_CPU
19
 
50
 
20
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
51
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
21
 
52
 
22
#define J3High    PORTD |= 0x20
53
#define J3High    PORTD |= 0x20
23
#define J3Low     PORTD &= ~0x20
54
#define J3Low     PORTD &= ~0x20
24
#define J4High    PORTD |= 0x10
55
#define J4High    PORTD |= 0x10
25
#define J4Low     PORTD &= ~0x10
56
#define J4Low     PORTD &= ~0x10
26
#define J5High    PORTD |= 0x08
57
#define J5High    PORTD |= 0x08
27
#define J5Low     PORTD &= ~0x08
58
#define J5Low     PORTD &= ~0x08
28
 
59
 
29
extern volatile unsigned char SenderOkay;
60
extern volatile unsigned char SenderOkay;
30
extern unsigned char BattLowVoltageWarning;
61
extern unsigned char BattLowVoltageWarning;
31
extern unsigned char CosinusNickWinkel, CosinusRollWinkel;
62
extern unsigned char CosinusNickWinkel, CosinusRollWinkel;
32
extern unsigned char PlatinenVersion;
63
extern unsigned char PlatinenVersion;
33
extern unsigned char FoundMotors,DisableRcOffBeeping;
64
extern unsigned char FoundMotors,DisableRcOffBeeping;
34
extern unsigned char JetiBeep;
65
extern unsigned char JetiBeep;
35
void LipoDetection(unsigned char print);
66
void LipoDetection(unsigned char print);
36
extern unsigned int FlugMinuten,FlugMinutenGesamt,FlugSekunden;
67
extern unsigned int FlugMinuten,FlugMinutenGesamt,FlugSekunden;
37
extern void PrintLine(void);  // "================================="
68
extern void PrintLine(void);  // "================================="
38
 
69
 
39
#include <avr/pgmspace.h>
70
#include <avr/pgmspace.h>
40
 
71
 
41
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))
72
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))
42
 
73
 
43
#endif
74
#endif
44
 
75
 
45
#include <stdlib.h>
76
#include <stdlib.h>
46
#include <string.h>
77
#include <string.h>
47
#include <avr/io.h>
78
#include <avr/io.h>
48
#include <avr/pgmspace.h>
79
#include <avr/pgmspace.h>
49
#include <avr/interrupt.h>
80
#include <avr/interrupt.h>
50
#include <avr/eeprom.h>
81
#include <avr/eeprom.h>
51
#include <avr/boot.h>
82
#include <avr/boot.h>
52
#include <avr/wdt.h>
83
#include <avr/wdt.h>
53
 
84
 
54
#include "old_macros.h"
85
#include "old_macros.h"
55
 
86
 
56
#include "printf_P.h"
87
#include "printf_P.h"
57
#include "timer0.h"
88
#include "timer0.h"
58
#include "uart.h"
89
#include "uart.h"
59
#include "analog.h"
90
#include "analog.h"
60
#include "twimaster.h"
91
#include "twimaster.h"
61
#include "menu.h"
92
#include "menu.h"
62
#include "rc.h"
93
#include "rc.h"
63
#include "fc.h"
94
#include "fc.h"
64
#include "gps.h"
95
#include "gps.h"
65
#include "spi.h"
96
#include "spi.h"
66
#include "led.h"
97
#include "led.h"
67
#include "spektrum.h"
98
#include "spektrum.h"
68
#include "capacity.h"
99
#include "capacity.h"
69
#include "eeprom.h"
100
#include "eeprom.h"
70
#include "libfc.h"
101
#include "libfc.h"
71
#include "hottmenu.h"
102
#include "hottmenu.h"
72
#include "debug.h"
103
#include "debug.h"
73
#include "sbus.h"
104
#include "sbus.h"
74
 
105
 
75
#endif //_MAIN_H
106
#endif //_MAIN_H
76
 
107
 
77
 
108
 
78
 
109
 
79
 
110
 
80
 
111
 
81
 
112
 
82
 
113