Subversion Repositories FlightCtrl

Rev

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

Rev 1799 Rev 1802
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
 
-
 
9
 
-
 
10
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))       
-
 
11
        #define NODISPLAY
-
 
12
#else
-
 
13
       
-
 
14
#endif
-
 
15
 
8
 
16
 
9
//#define NODISPLAY // MartinW;  with "//" = no MKTool Display
17
//#define NODISPLAY // MartinW;  with "//" = no MKTool Display
10
 
18
 
11
// neue Hardware
19
// neue Hardware
12
#define ROT_OFF   {if((PlatinenVersion == 10)||(PlatinenVersion >= 20)) PORTB &=~0x01; else  PORTB |= 0x01;}
20
#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;}
21
#define ROT_ON    {if((PlatinenVersion == 10)||(PlatinenVersion >= 20)) PORTB |= 0x01; else  PORTB &=~0x01;}
14
#define ROT_FLASH PORTB ^= 0x01
22
#define ROT_FLASH PORTB ^= 0x01
15
#define GRN_OFF   {if((PlatinenVersion < 12)) PORTB &=~0x02; else PORTB |= 0x02;}
23
#define GRN_OFF   {if((PlatinenVersion < 12)) PORTB &=~0x02; else PORTB |= 0x02;}
16
#define GRN_ON    {if((PlatinenVersion < 12)) PORTB |= 0x02; else PORTB &=~0x02;}
24
#define GRN_ON    {if((PlatinenVersion < 12)) PORTB |= 0x02; else PORTB &=~0x02;}
17
#define GRN_FLASH PORTB ^= 0x02
25
#define GRN_FLASH PORTB ^= 0x02
18
 
26
 
19
#define SYSCLK F_CPU
27
#define SYSCLK F_CPU
20
 
28
 
21
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
22
 
30
 
23
#define J3High    PORTD |= 0x20
31
#define J3High    PORTD |= 0x20
24
#define J3Low     PORTD &= ~0x20
32
#define J3Low     PORTD &= ~0x20
25
#define J4High    PORTD |= 0x10
33
#define J4High    PORTD |= 0x10
26
#define J4Low     PORTD &= ~0x10
34
#define J4Low     PORTD &= ~0x10
27
#define J5High    PORTD |= 0x08
35
#define J5High    PORTD |= 0x08
28
#define J5Low     PORTD &= ~0x08
36
#define J5Low     PORTD &= ~0x08
29
 
37
 
30
extern volatile unsigned char SenderOkay;
38
extern volatile unsigned char SenderOkay;
31
extern unsigned char BattLowVoltageWarning;
39
extern unsigned char BattLowVoltageWarning;
32
extern unsigned char CosinusNickWinkel, CosinusRollWinkel;
40
extern unsigned char CosinusNickWinkel, CosinusRollWinkel;
33
extern unsigned char PlatinenVersion;
41
extern unsigned char PlatinenVersion;
34
extern unsigned char SendVersionToNavi;
42
extern unsigned char SendVersionToNavi;
35
extern unsigned char FoundMotors;
43
extern unsigned char FoundMotors;
36
 
44
 
37
void LipoDetection(unsigned char print);
45
void LipoDetection(unsigned char print);
38
extern unsigned int FlugMinuten,FlugMinutenGesamt,FlugSekunden;
46
extern unsigned int FlugMinuten,FlugMinutenGesamt,FlugSekunden;
39
 
47
 
40
#include <stdlib.h>
48
#include <stdlib.h>
41
#include <string.h>
49
#include <string.h>
42
#include <avr/io.h>
50
#include <avr/io.h>
43
#include <avr/pgmspace.h>
51
#include <avr/pgmspace.h>
44
#include <avr/interrupt.h>
52
#include <avr/interrupt.h>
45
#include <avr/eeprom.h>
53
#include <avr/eeprom.h>
46
#include <avr/boot.h>
54
#include <avr/boot.h>
47
#include <avr/wdt.h>
55
#include <avr/wdt.h>
48
 
56
 
49
 
57
 
50
#include "old_macros.h"
58
#include "old_macros.h"
51
 
59
 
52
#include "printf_P.h"
60
#include "printf_P.h"
53
#include "timer0.h"
61
#include "timer0.h"
54
#include "uart.h"
62
#include "uart.h"
55
#include "analog.h"
63
#include "analog.h"
56
#include "twimaster.h"
64
#include "twimaster.h"
57
#include "menu.h"
65
#include "menu.h"
58
#include "rc.h"
66
#include "rc.h"
59
#include "fc.h"
67
#include "fc.h"
60
#include "gps.h"
68
#include "gps.h"
61
#include "spi.h"
69
#include "spi.h"
62
#include "led.h"
70
#include "led.h"
63
#include "spektrum.h"
71
#include "spektrum.h"
64
#include "capacity.h"
72
#include "capacity.h"
65
#include "eeprom.h"
73
#include "eeprom.h"
66
#include "libfc.h"
74
#include "libfc.h"
67
#include "debug.h"
75
#include "debug.h"
68
 
76
 
69
 
77
 
70
 
78
 
71
#endif //_MAIN_H
79
#endif //_MAIN_H
72
 
80
 
73
 
81
 
74
 
82
 
75
 
83
 
76
 
84
 
77
 
85
 
78
 
86