Subversion Repositories FlightCtrl

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 ingob 1
#ifndef _MAIN_H
2
 #define _MAIN_H
3
 
1176 hbuss 4
#define QUADRO
1111 hbuss 5
 
1438 ingob 6
//#define ACT_S3D_SUMMENSIGNAL
7
 
1 ingob 8
// neue Hardware
1021 hbuss 9
#define ROT_OFF   {if((PlatinenVersion == 10)||(PlatinenVersion == 20)) PORTB &=~0x01; else  PORTB |= 0x01;}
10
#define ROT_ON    {if((PlatinenVersion == 10)||(PlatinenVersion == 20)) PORTB |= 0x01; else  PORTB &=~0x01;}
1 ingob 11
#define ROT_FLASH PORTB ^= 0x01
1058 killagreg 12
#define GRN_OFF   {if((PlatinenVersion < 12)) PORTB &=~0x02; else PORTB |= 0x02;}
13
#define GRN_ON    {if((PlatinenVersion < 12)) PORTB |= 0x02; else PORTB &=~0x02;}
173 holgerb 14
#define GRN_FLASH PORTB ^= 0x02
1 ingob 15
 
1435 killagreg 16
#define SYSCLK F_CPU
17
 
1 ingob 18
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1403 hbuss 19
#define EE_DATENREVISION 82 // Parameter fürs Koptertool; wird angepasst, wenn sich die EEPROM-Daten geändert haben
1211 hbuss 20
#define MIXER_REVISION    1 // wird angepasst, wenn sich die Mixer-Daten geändert haben
1 ingob 21
 
22
#define EEPROM_ADR_VALID            1
23
#define EEPROM_ADR_ACTIVE_SET       2
173 holgerb 24
#define EEPROM_ADR_LAST_OFFSET      3
1 ingob 25
 
513 hbuss 26
#define EEPROM_ADR_ACC_NICK         4
27
#define EEPROM_ADR_ACC_ROLL         6
28
#define EEPROM_ADR_ACC_Z            8
1298 hbuss 29
#define EEPROM_ADR_MINUTES         10
30
#define EEPROM_ADR_MINUTES2        14
513 hbuss 31
 
1171 hbuss 32
#define EEPROM_ADR_CHANNELS          80
33
 
34
#define EEPROM_ADR_PARAM_LENGTH      98
1 ingob 35
#define EEPROM_ADR_PARAM_BEGIN      100
36
 
1211 hbuss 37
#define EEPROM_ADR_MIXER_TABLE     1000 // 1001 - 1100
1209 hbuss 38
 
395 hbuss 39
#define CFG_HOEHENREGELUNG       0x01
40
#define CFG_HOEHEN_SCHALTER      0x02
41
#define CFG_HEADING_HOLD         0x04
42
#define CFG_KOMPASS_AKTIV        0x08
43
#define CFG_KOMPASS_FIX          0x10
44
#define CFG_GPS_AKTIV            0x20
45
#define CFG_ACHSENKOPPLUNG_AKTIV 0x40
46
#define CFG_DREHRATEN_BEGRENZER  0x80
1 ingob 47
 
1309 hbuss 48
#define CFG_LOOP_OBEN            0x01
49
#define CFG_LOOP_UNTEN           0x02
50
#define CFG_LOOP_LINKS           0x04
51
#define CFG_LOOP_RECHTS          0x08
52
#define CFG_MOTOR_BLINK          0x10
1350 hbuss 53
#define CFG_MOTOR_OFF_LED1       0x20
54
#define CFG_MOTOR_OFF_LED2       0x40
1309 hbuss 55
#define CFG_RES4                         0x80
1 ingob 56
 
1309 hbuss 57
#define CFG2_HEIGHT_LIMIT        0x01
58
#define CFG2_VARIO_BEEP          0x02
59
#define CFG_SENSITIVE_RC         0x04
60
 
1481 holgerb 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
67
#define RECEIVER_UNKNOWN        0xFF
68
 
1155 hbuss 69
#define J3High    PORTD |= 0x20
70
#define J3Low     PORTD &= ~0x20
71
#define J4High    PORTD |= 0x10
72
#define J4Low     PORTD &= ~0x10
73
#define J5High    PORTD |= 0x08
74
#define J5Low     PORTD &= ~0x08
75
 
1 ingob 76
extern volatile unsigned char SenderOkay;
1236 killagreg 77
extern unsigned char BattLowVoltageWarning;
1 ingob 78
extern unsigned char CosinusNickWinkel, CosinusRollWinkel;
173 holgerb 79
extern unsigned char PlatinenVersion;
723 hbuss 80
extern unsigned char SendVersionToNavi;
304 ingob 81
void ReadParameterSet (unsigned char number, unsigned char *buffer, unsigned char length);
82
void WriteParameterSet(unsigned char number, unsigned char *buffer, unsigned char length);
1 ingob 83
extern unsigned char GetActiveParamSetNumber(void);
1063 killagreg 84
void SetActiveParamSetNumber(unsigned char number);
1268 hbuss 85
void LipoDetection(unsigned char print);
1 ingob 86
extern unsigned char EEPromArray[];
1298 hbuss 87
extern unsigned int FlugMinuten,FlugMinutenGesamt;
1 ingob 88
 
89
#include <stdlib.h>
90
#include <string.h>
91
#include <avr/io.h>
92
#include <avr/pgmspace.h>
93
#include <avr/interrupt.h>
94
#include <avr/eeprom.h>
95
#include <avr/boot.h>
96
#include <avr/wdt.h>
97
 
1438 ingob 98
 
1 ingob 99
#include "old_macros.h"
100
 
395 hbuss 101
#include "_Settings.h"
1 ingob 102
#include "printf_P.h"
103
#include "timer0.h"
104
#include "uart.h"
105
#include "analog.h"
106
#include "twimaster.h"
107
#include "menu.h"
108
#include "rc.h"
109
#include "fc.h"
110
#include "gps.h"
304 ingob 111
#include "spi.h"
921 hbuss 112
#include "led.h"
1424 ingob 113
#include "spektrum.h"
1435 killagreg 114
#include "libfc.h"
1 ingob 115
 
1419 ingob 116
 
1438 ingob 117
 
1 ingob 118
#ifndef EEMEM
119
#define EEMEM __attribute__ ((section (".eeprom")))
120
#endif
121
 
122
#define DEBUG_DISPLAY_INTERVALL  123 // in ms
123
 
124
 
125
#define DELAY_US(x)     ((unsigned int)( (x) * 1e-6 * F_CPU ))
1058 killagreg 126
 
1 ingob 127
#endif //_MAIN_H
128
 
129
 
130
 
131
 
132
 
133