Subversion Repositories FlightCtrl

Rev

Rev 1378 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1378 Rev 1550
Line 1... Line 1...
1
#ifndef _MAIN_H
1
#ifndef _MAIN_H
2
 #define _MAIN_H
2
 #define _MAIN_H
Line 3... Line 3...
3
 
3
 
Line 4... Line -...
4
#define QUADRO
-
 
5
 
-
 
6
//Hier die Quarz Frequenz einstellen
-
 
7
#if defined (__AVR_ATmega32__)
-
 
8
#define SYSCLK  20000000L       //Quarz Frequenz in Hz
-
 
9
#endif
4
#define QUADRO
10
 
-
 
11
#if defined (__AVR_ATmega644__)
-
 
12
#define SYSCLK  20000000L       //Quarz Frequenz in Hz
-
 
13
#endif
-
 
14
 
-
 
15
#if defined (__AVR_ATmega644P__)
-
 
Line 16... Line 5...
16
#define SYSCLK  20000000L       //Quarz Frequenz in Hz
5
 
17
#endif
6
//#define ACT_S3D_SUMMENSIGNAL
18
 
7
 
19
// neue Hardware
8
// neue Hardware
20
#define ROT_OFF   {if((PlatinenVersion == 10)||(PlatinenVersion == 20)) PORTB &=~0x01; else  PORTB |= 0x01;}
9
#define ROT_OFF   {if((PlatinenVersion == 10)||(PlatinenVersion == 20)) PORTB &=~0x01; else  PORTB |= 0x01;}
21
#define ROT_ON    {if((PlatinenVersion == 10)||(PlatinenVersion == 20)) PORTB |= 0x01; else  PORTB &=~0x01;}
10
#define ROT_ON    {if((PlatinenVersion == 10)||(PlatinenVersion == 20)) PORTB |= 0x01; else  PORTB &=~0x01;}
22
#define ROT_FLASH PORTB ^= 0x01
11
#define ROT_FLASH PORTB ^= 0x01
Line 23... Line 12...
23
#define GRN_OFF   {if((PlatinenVersion < 12)) PORTB &=~0x02; else PORTB |= 0x02;}
12
#define GRN_OFF   {if((PlatinenVersion < 12)) PORTB &=~0x02; else PORTB |= 0x02;}
24
#define GRN_ON    {if((PlatinenVersion < 12)) PORTB |= 0x02; else PORTB &=~0x02;}
-
 
25
#define GRN_FLASH PORTB ^= 0x02
-
 
26
 
13
#define GRN_ON    {if((PlatinenVersion < 12)) PORTB |= 0x02; else PORTB &=~0x02;}
27
#define F_CPU SYSCLK
14
#define GRN_FLASH PORTB ^= 0x02
28
//#ifndef F_CPU
15
 
29
//#error ################## F_CPU nicht definiert oder ungültig #############
16
#define SYSCLK F_CPU
Line 30... Line 17...
30
//#endif
17
 
31
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
18
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
32
#define EE_DATENREVISION 80 // wird angepasst, wenn sich die EEPROM-Daten geändert haben
19
#define EE_DATENREVISION 82 // Parameter fürs Koptertool; wird angepasst, wenn sich die EEPROM-Daten geändert haben
Line 69... Line 56...
69
 
56
 
70
#define CFG2_HEIGHT_LIMIT        0x01
57
#define CFG2_HEIGHT_LIMIT        0x01
71
#define CFG2_VARIO_BEEP          0x02
58
#define CFG2_VARIO_BEEP          0x02
Line -... Line 59...
-
 
59
#define CFG_SENSITIVE_RC         0x04
-
 
60
 
-
 
61
#define RECEIVER_PPM                            0
-
 
62
#define RECEIVER_SPEKTRUM                       1
-
 
63
#define RECEIVER_SPEKTRUM_HI_RES        2
-
 
64
#define RECEIVER_SPEKTRUM_LOW_RES       3
-
 
65
#define RECEIVER_JETI                           4
-
 
66
#define RECEIVER_ACT_DSL                        5
72
#define CFG_SENSITIVE_RC         0x04
67
#define RECEIVER_UNKNOWN        0xFF
73
 
68
 
74
#define J3High    PORTD |= 0x20
69
#define J3High    PORTD |= 0x20
75
#define J3Low     PORTD &= ~0x20
70
#define J3Low     PORTD &= ~0x20
76
#define J4High    PORTD |= 0x10
71
#define J4High    PORTD |= 0x10
77
#define J4Low     PORTD &= ~0x10
72
#define J4Low     PORTD &= ~0x10
Line 78... Line -...
78
#define J5High    PORTD |= 0x08
-
 
79
#define J5Low     PORTD &= ~0x08
-
 
80
 
-
 
81
 
73
#define J5High    PORTD |= 0x08
82
//#define  SYSCLK
74
#define J5Low     PORTD &= ~0x08
83
//extern unsigned long SYSCLK;
75
 
84
extern volatile unsigned char SenderOkay;
76
extern volatile unsigned char SenderOkay;
85
extern unsigned char BattLowVoltageWarning;
77
extern unsigned char BattLowVoltageWarning;
Line 90... Line 82...
90
void WriteParameterSet(unsigned char number, unsigned char *buffer, unsigned char length);
82
void WriteParameterSet(unsigned char number, unsigned char *buffer, unsigned char length);
91
extern unsigned char GetActiveParamSetNumber(void);
83
extern unsigned char GetActiveParamSetNumber(void);
92
void SetActiveParamSetNumber(unsigned char number);
84
void SetActiveParamSetNumber(unsigned char number);
93
void LipoDetection(unsigned char print);
85
void LipoDetection(unsigned char print);
94
extern unsigned char EEPromArray[];
86
extern unsigned char EEPromArray[];
95
extern unsigned int FlugMinuten,FlugMinutenGesamt;
87
extern unsigned int FlugMinuten,FlugMinutenGesamt,FlugSekunden;
Line 96... Line 88...
96
 
88
 
97
#include <stdlib.h>
89
#include <stdlib.h>
98
#include <string.h>
90
#include <string.h>
99
#include <avr/io.h>
91
#include <avr/io.h>
100
#include <avr/pgmspace.h>
92
#include <avr/pgmspace.h>
101
#include <avr/interrupt.h>
93
#include <avr/interrupt.h>
102
#include <avr/eeprom.h>
94
#include <avr/eeprom.h>
103
#include <avr/boot.h>
95
#include <avr/boot.h>
Line -... Line 96...
-
 
96
#include <avr/wdt.h>
104
#include <avr/wdt.h>
97
 
Line 105... Line 98...
105
 
98
 
106
#include "old_macros.h"
99
#include "old_macros.h"
107
 
100
 
Line 115... Line 108...
115
#include "rc.h"
108
#include "rc.h"
116
#include "fc.h"
109
#include "fc.h"
117
#include "gps.h"
110
#include "gps.h"
118
#include "spi.h"
111
#include "spi.h"
119
#include "led.h"
112
#include "led.h"
-
 
113
#include "spektrum.h"
-
 
114
#include "capacity.h"
-
 
115
#include "libfc.h"
-
 
116
 
-
 
117
 
Line 120... Line 118...
120
 
118
 
121
#ifndef EEMEM
119
#ifndef EEMEM
122
#define EEMEM __attribute__ ((section (".eeprom")))
120
#define EEMEM __attribute__ ((section (".eeprom")))