Subversion Repositories FlightCtrl

Rev

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

Rev Author Line No. Line
838 MikeW 1
#ifndef _MAIN_H
2
 #define _MAIN_H
3
 
4
//Hier die Quarz Frequenz einstellen
5
#if defined (__AVR_ATmega32__)
6
#define SYSCLK  20000000L       //Quarz Frequenz in Hz
7
#endif
8
 
9
#if defined (__AVR_ATmega644__)
10
#define SYSCLK  20000000L       //Quarz Frequenz in Hz
11
#endif
12
 
13
// neue Hardware
14
#define ROT_OFF   PORTB |= 0x01;
15
#define ROT_ON    PORTB &=~0x01;
16
#define ROT_FLASH PORTB ^= 0x01
17
#define GRN_OFF   PORTB &=~0x02 
18
#define GRN_ON    PORTB |= 0x02 
19
#define GRN_FLASH PORTB ^= 0x02
20
 
21
#define F_CPU SYSCLK
22
//#ifndef F_CPU
23
//#error ################## F_CPU nicht definiert oder ungültig #############
24
//#endif
25
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
26
 
27
#define EEPROM_ADR_VALID            1
28
#define EEPROM_ADR_ACTIVE_SET       2
29
#define EEPROM_ADR_LAST_OFFSET      3
30
 
31
#define PID_MM3_X_OFF           10 // word
32
#define PID_MM3_Y_OFF           12 // word
33
#define PID_MM3_Z_OFF           14 // word
34
#define PID_MM3_X_RANGE         16 // word
35
#define PID_MM3_Y_RANGE         18 // word
36
#define PID_MM3_Z_RANGE         20 // word
37
 
38
#define EEPROM_ADR_PARAM_BEGIN      100
39
 
40
#define CFG_HOEHENREGELUNG       0x01
41
#define CFG_HOEHEN_SCHALTER      0x02
42
#define CFG_HEADING_HOLD         0x04
43
#define CFG_KOMPASS_AKTIV        0x08
44
#define CFG_KOMPASS_FIX          0x10
45
#define CFG_GPS_AKTIV            0x20
46
#define CFG_ACHSENKOPPLUNG_AKTIV 0x40
47
#define CFG_DREHRATEN_BEGRENZER  0x80
48
 
49
#define MIN(a, b) ((a) < (b) ? (a) : (b)) 
50
#define MAX(a, b) ((a) > (b) ? (a) : (b))
51
 
52
extern unsigned char SenderOkay;
53
extern unsigned char GetActiveParamSetNumber(void);
54
extern unsigned char EEPromArray[];
55
 
56
void ReadParameterSet (unsigned char number, unsigned char *buffer, unsigned char length);
57
void WriteParameterSet(unsigned char number, unsigned char *buffer, unsigned char length);
58
 
59
 
60
#include <stdlib.h>
61
#include <string.h>
62
#include <avr/io.h>
63
#include <avr/pgmspace.h>
64
#include <avr/interrupt.h>
65
#include <avr/eeprom.h>
66
#include <avr/boot.h>
67
#include <avr/wdt.h>
68
 
69
#include "old_macros.h"
70
 
71
#include "_Settings.h"
72
#include "printf_P.h"
73
#include "timer0.h"
74
#include "uart.h"
75
#include "analog.h"
76
#include "twimaster.h"
77
#include "menu.h"
78
#include "rc.h"
79
#include "fc.h"
80
#include "gps.h"
81
 
82
 
83
#ifndef EEMEM
84
#define EEMEM __attribute__ ((section (".eeprom")))
85
#endif
86
 
87
#endif //_MAIN_H
88
 
89
 
90
 
91
 
92
 
93