Subversion Repositories FlightCtrl

Rev

Rev 2418 | Rev 2427 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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