Subversion Repositories FlightCtrl

Rev

Rev 2727 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 ingob 1
#ifndef _MAIN_H
1622 killagreg 2
#define _MAIN_H
1 ingob 3
 
2427 holgerb 4
//#define REDUNDANT_FC_SLAVE
2643 holgerb 5
//#define REDUNDANT_FC_MASTER
2727 holgerb 6
//#define NO_RECEIVER                   // to operate without a receiver -> only for simulation
2418 holgerb 7
 
1923 holgerb 8
//#define DEBUG                                                 // use to activate debug output to MK-Tool: use Debug(text);
1438 ingob 9
//#define ACT_S3D_SUMMENSIGNAL
2008 holgerb 10
//#define UserParameter8_FAILSAFE
1928 holgerb 11
//#define RECEIVER_SPEKTRUM_DX7EXP
12
//#define RECEIVER_SPEKTRUM_DX8EXP
1438 ingob 13
 
1 ingob 14
// neue Hardware
2426 holgerb 15
//#define ROT_OFF   {if((PlatinenVersion == 10)||(PlatinenVersion >= 20)) PORTB &=~0x01; else  PORTB |= 0x01;}
16
//#define ROT_ON    {if((PlatinenVersion == 10)||(PlatinenVersion >= 20)) PORTB |= 0x01; else  PORTB &=~0x01;}
17
 
18
#define ROT_OFF   {PORTB &=~0x01;}
19
#define ROT_ON    {PORTB |= 0x01;}
20
 
1 ingob 21
#define ROT_FLASH PORTB ^= 0x01
2426 holgerb 22
//#define GRN_OFF   {if((PlatinenVersion < 12) || PlatinenVersion == 25) PORTB &=~0x02; else PORTB |= 0x02;}
23
//#define GRN_ON    {if((PlatinenVersion < 12) || PlatinenVersion == 25) PORTB |= 0x02; else PORTB &=~0x02;}
2597 holgerb 24
#define GRN_OFF   {if(PlatinenVersion >= 25) PORTB &=~0x02; else PORTB |= 0x02;}
25
#define GRN_ON    {if(PlatinenVersion >= 25) PORTB |= 0x02; else PORTB &=~0x02;}
173 holgerb 26
#define GRN_FLASH PORTB ^= 0x02
1 ingob 27
 
1435 killagreg 28
#define SYSCLK F_CPU
29
 
1 ingob 30
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
31
 
1155 hbuss 32
#define J3High    PORTD |= 0x20
33
#define J3Low     PORTD &= ~0x20
34
#define J4High    PORTD |= 0x10
35
#define J4Low     PORTD &= ~0x10
36
#define J5High    PORTD |= 0x08
37
#define J5Low     PORTD &= ~0x08
2617 holgerb 38
#define UART_MUX_TO_BL                          PORTD |= 0x10
39
#define UART_MUX_TO_UPDATE                      PORTD &= ~0x10
1155 hbuss 40
 
1236 killagreg 41
extern unsigned char BattLowVoltageWarning;
2416 holgerb 42
extern unsigned char BattAutoLandingVoltage, BattComingHomeVoltage;
1 ingob 43
extern unsigned char CosinusNickWinkel, CosinusRollWinkel;
173 holgerb 44
extern unsigned char PlatinenVersion;
2029 holgerb 45
extern unsigned char FoundMotors,DisableRcOffBeeping;
1834 holgerb 46
extern unsigned char JetiBeep;
1268 hbuss 47
void LipoDetection(unsigned char print);
1512 holgerb 48
extern unsigned int FlugMinuten,FlugMinutenGesamt,FlugSekunden;
2030 holgerb 49
extern void PrintLine(void);  // "================================="
2333 holgerb 50
extern unsigned char ActiveParamSet;
2386 holgerb 51
extern unsigned int BL3_Current(unsigned char who); // in 0,1A
2402 holgerb 52
extern unsigned char LipoCells;
2617 holgerb 53
extern unsigned char Delete_Stoppflag_Timer;
2627 holgerb 54
extern void InitSerialPoti(void);
2679 holgerb 55
extern unsigned char TouchDownTimer;
2660 holgerb 56
unsigned char OEM_String[17];
2727 holgerb 57
extern unsigned char TimerSpeakReady;
1 ingob 58
 
2617 holgerb 59
#define NOTHING                 0
60
#define MASTER                  1
61
#define SLAVE                   2
62
extern unsigned char IamMaster;
63
 
64
 
1930 holgerb 65
#include <avr/pgmspace.h>
66
 
67
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))
68
 
69
#endif
70
 
1 ingob 71
#include <stdlib.h>
72
#include <string.h>
73
#include <avr/io.h>
74
#include <avr/pgmspace.h>
75
#include <avr/interrupt.h>
76
#include <avr/eeprom.h>
77
#include <avr/boot.h>
78
#include <avr/wdt.h>
79
 
80
#include "old_macros.h"
81
 
82
#include "printf_P.h"
83
#include "timer0.h"
84
#include "uart.h"
85
#include "analog.h"
86
#include "twimaster.h"
87
#include "menu.h"
88
#include "rc.h"
89
#include "fc.h"
90
#include "gps.h"
304 ingob 91
#include "spi.h"
921 hbuss 92
#include "led.h"
1424 ingob 93
#include "spektrum.h"
1486 killagreg 94
#include "capacity.h"
1622 killagreg 95
#include "eeprom.h"
1435 killagreg 96
#include "libfc.h"
1917 holgerb 97
#include "hottmenu.h"
1636 ingob 98
#include "debug.h"
2012 holgerb 99
#include "sbus.h"
2263 holgerb 100
#include "jeti_ex.h"
2543 holgerb 101
#include "M-Link.h"
1 ingob 102
 
103
#endif //_MAIN_H
104
 
105
 
106
 
107
 
108
 
109