Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
375 | osiair | 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 | //#define SYSCLK 16000000L //Quarz Frequenz in Hz |
||
12 | #endif |
||
13 | |||
14 | // neue Hardware |
||
15 | #define ROT_OFF PORTB &=~(1<<PB0) |
||
16 | #define ROT_ON PORTB |= (1<<PB0) |
||
17 | #define ROT_FLASH PORTB ^= (1<<PB0) |
||
18 | #define GRN_OFF PORTB &=~(1<<PB1) |
||
19 | #define GRN_ON PORTB |= (1<<PB1) |
||
20 | #define GRN_FLASH PORTD ^= (1<<PB1) |
||
21 | |||
22 | |||
23 | /* |
||
24 | #define ROT_OFF {if(PlatinenVersion == 10) PORTB &=~0x01; else PORTB |= 0x01;} |
||
25 | #define ROT_ON {if(PlatinenVersion == 10) PORTB |= 0x01; else PORTB &=~0x01;} |
||
26 | #define ROT_FLASH PORTB ^= 0x01 |
||
27 | #define GRN_OFF PORTB &=~0x02 |
||
28 | #define GRN_ON PORTB |= 0x02 |
||
29 | #define GRN_FLASH PORTB ^= 0x02 |
||
30 | */ |
||
31 | #define LED1_OFF PORTC &=~0x04 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
||
32 | #define LED1_ON PORTC |= 0x04 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
||
33 | #define LED1_FLASH PORTC ^= 0x04 //Erweiterung by 4ndreas aus mikrosvn branches // (280807Kr) |
||
34 | #define LED2_OFF PORTC &=~0x08 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
||
35 | #define LED2_ON PORTC |= 0x08 //Erweiterung von Smartie aus dem MK-Forum vom 14.06.07. Dadurch können die Transistorausgänge J16 und J17 geschaltet werden. // (160607Kr) |
||
36 | #define LED2_FLASH PORTC ^= 0x08 //Erweiterung by 4ndreas aus mikrosvn branches // (280807Kr) |
||
37 | |||
38 | |||
39 | |||
40 | |||
41 | |||
42 | |||
43 | //#ifndef F_CPU |
||
44 | //#error ################## F_CPU nicht definiert oder ungültig ############# |
||
45 | //#endif |
||
46 | |||
47 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
48 | |||
49 | //#define ANZ_MITTELWERT 4 |
||
50 | |||
51 | #define EEPROM_ADR_VALID 1 |
||
52 | #define EEPROM_ADR_ACTIVE_SET 2 |
||
53 | #define EEPROM_ADR_LAST_OFFSET 3 |
||
54 | |||
55 | #define EEPROM_ADR_PARAM_BEGIN 100 |
||
56 | |||
57 | #define CFG_HOEHENREGELUNG 0x01 |
||
58 | #define CFG_HOEHEN_SCHALTER 0x02 |
||
59 | #define CFG_HEADING_HOLD 0x04 |
||
60 | #define CFG_KOMPASS_AKTIV 0x08 |
||
61 | #define CFG_KOMPASS_FIX 0x10 |
||
62 | #define CFG_GPS_AKTIV 0x20 |
||
63 | |||
64 | #define CFG_LOOP_OBEN 0x01 |
||
65 | #define CFG_LOOP_UNTEN 0x02 |
||
66 | #define CFG_LOOP_LINKS 0x04 |
||
67 | #define CFG_LOOP_RECHTS 0x08 |
||
68 | |||
69 | //#define SYSCLK |
||
70 | //extern unsigned long SYSCLK; |
||
71 | extern volatile int i_Nick[20],i_Roll[20],DiffNick,DiffRoll; |
||
72 | extern volatile unsigned char SenderOkay; |
||
73 | extern unsigned char CosinusNickWinkel, CosinusRollWinkel; |
||
74 | extern unsigned char PlatinenVersion; |
||
75 | |||
76 | extern void ReadParameterSet (unsigned char number, unsigned char *buffer, unsigned char length); |
||
77 | extern void WriteParameterSet(unsigned char number, unsigned char *buffer, unsigned char length); |
||
78 | extern unsigned char GetActiveParamSetNumber(void); |
||
79 | extern unsigned char EEPromArray[]; |
||
80 | |||
81 | long durchschnitt_northing; |
||
82 | long durchschnitt_easting; |
||
83 | |||
84 | volatile int P_GPS_Verstaerkung; //P-Anteil (80-120) |
||
85 | volatile int D_GPS_Verstaerkung; //D-Anteil (90) |
||
86 | |||
87 | #include <stdlib.h> |
||
88 | #include <string.h> |
||
89 | #include <avr/io.h> |
||
90 | #include <avr/pgmspace.h> |
||
91 | #include <avr/interrupt.h> |
||
92 | #include <avr/eeprom.h> |
||
93 | #include <avr/boot.h> |
||
94 | #include <avr/wdt.h> |
||
95 | |||
96 | #include "old_macros.h" |
||
97 | |||
98 | #include "_settings.h" |
||
99 | #include "printf_P.h" |
||
100 | #include "compass.h" //Nick666 |
||
101 | #include "timer0.h" |
||
102 | #include "uart.h" |
||
103 | #include "analog.h" |
||
104 | #include "twimaster.h" |
||
105 | #include "menu.h" |
||
106 | #include "rc.h" |
||
107 | #include "fc.h" |
||
108 | #include "gps.h" |
||
109 | #include "math.h" //Nick666 |
||
110 | |||
111 | |||
112 | #ifndef EEMEM |
||
113 | #define EEMEM __attribute__ ((section (".eeprom"))) |
||
114 | #endif |
||
115 | |||
116 | #define DEBUG_DISPLAY_INTERVALL 123 // in ms |
||
117 | |||
118 | |||
119 | #define DELAY_US(x) ((unsigned int)( (x) * 1e-6 * F_CPU )) |
||
120 | |||
121 | #endif //_MAIN_H |
||
122 | |||
123 | |||
124 | |||
125 | |||
126 | |||
127 |