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 | |||
1166 | hbuss | 4 | #define QUADRO |
1111 | hbuss | 5 | //#define OCTO |
1166 | hbuss | 6 | //#define OCTO2 |
1111 | hbuss | 7 | |
1166 | hbuss | 8 | |
1 | ingob | 9 | //Hier die Quarz Frequenz einstellen |
10 | #if defined (__AVR_ATmega32__) |
||
11 | #define SYSCLK 20000000L //Quarz Frequenz in Hz |
||
12 | #endif |
||
13 | |||
14 | #if defined (__AVR_ATmega644__) |
||
15 | #define SYSCLK 20000000L //Quarz Frequenz in Hz |
||
16 | //#define SYSCLK 16000000L //Quarz Frequenz in Hz |
||
17 | #endif |
||
18 | |||
19 | // neue Hardware |
||
1021 | hbuss | 20 | #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;} |
||
1 | ingob | 22 | #define ROT_FLASH PORTB ^= 0x01 |
1058 | killagreg | 23 | #define GRN_OFF {if((PlatinenVersion < 12)) PORTB &=~0x02; else PORTB |= 0x02;} |
24 | #define GRN_ON {if((PlatinenVersion < 12)) PORTB |= 0x02; else PORTB &=~0x02;} |
||
173 | holgerb | 25 | #define GRN_FLASH PORTB ^= 0x02 |
1 | ingob | 26 | |
304 | ingob | 27 | #define F_CPU SYSCLK |
1 | ingob | 28 | //#ifndef F_CPU |
29 | //#error ################## F_CPU nicht definiert oder ungültig ############# |
||
30 | //#endif |
||
31 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
1120 | hbuss | 32 | #define EE_DATENREVISION 74 // wird angepasst, wenn sich die EEPROM-Daten geändert haben |
1 | ingob | 33 | |
34 | #define EEPROM_ADR_VALID 1 |
||
35 | #define EEPROM_ADR_ACTIVE_SET 2 |
||
173 | holgerb | 36 | #define EEPROM_ADR_LAST_OFFSET 3 |
1 | ingob | 37 | |
513 | hbuss | 38 | #define EEPROM_ADR_ACC_NICK 4 |
39 | #define EEPROM_ADR_ACC_ROLL 6 |
||
40 | #define EEPROM_ADR_ACC_Z 8 |
||
41 | |||
1 | ingob | 42 | #define EEPROM_ADR_PARAM_BEGIN 100 |
43 | |||
395 | hbuss | 44 | #define CFG_HOEHENREGELUNG 0x01 |
45 | #define CFG_HOEHEN_SCHALTER 0x02 |
||
46 | #define CFG_HEADING_HOLD 0x04 |
||
47 | #define CFG_KOMPASS_AKTIV 0x08 |
||
48 | #define CFG_KOMPASS_FIX 0x10 |
||
49 | #define CFG_GPS_AKTIV 0x20 |
||
50 | #define CFG_ACHSENKOPPLUNG_AKTIV 0x40 |
||
51 | #define CFG_DREHRATEN_BEGRENZER 0x80 |
||
1 | ingob | 52 | |
173 | holgerb | 53 | #define CFG_LOOP_OBEN 0x01 |
54 | #define CFG_LOOP_UNTEN 0x02 |
||
55 | #define CFG_LOOP_LINKS 0x04 |
||
56 | #define CFG_LOOP_RECHTS 0x08 |
||
993 | hbuss | 57 | #define CFG_HIGHT_3SWITCH 0x10 |
1 | ingob | 58 | |
1155 | hbuss | 59 | #define J3High PORTD |= 0x20 |
60 | #define J3Low PORTD &= ~0x20 |
||
61 | #define J4High PORTD |= 0x10 |
||
62 | #define J4Low PORTD &= ~0x10 |
||
63 | #define J5High PORTD |= 0x08 |
||
64 | #define J5Low PORTD &= ~0x08 |
||
65 | |||
66 | |||
1058 | killagreg | 67 | //#define SYSCLK |
1 | ingob | 68 | //extern unsigned long SYSCLK; |
69 | extern volatile unsigned char SenderOkay; |
||
70 | extern unsigned char CosinusNickWinkel, CosinusRollWinkel; |
||
173 | holgerb | 71 | extern unsigned char PlatinenVersion; |
723 | hbuss | 72 | extern unsigned char SendVersionToNavi; |
304 | ingob | 73 | void ReadParameterSet (unsigned char number, unsigned char *buffer, unsigned char length); |
74 | void WriteParameterSet(unsigned char number, unsigned char *buffer, unsigned char length); |
||
1 | ingob | 75 | extern unsigned char GetActiveParamSetNumber(void); |
1063 | killagreg | 76 | void SetActiveParamSetNumber(unsigned char number); |
1 | ingob | 77 | extern unsigned char EEPromArray[]; |
78 | |||
79 | #include <stdlib.h> |
||
80 | #include <string.h> |
||
81 | #include <avr/io.h> |
||
82 | #include <avr/pgmspace.h> |
||
83 | #include <avr/interrupt.h> |
||
84 | #include <avr/eeprom.h> |
||
85 | #include <avr/boot.h> |
||
86 | #include <avr/wdt.h> |
||
87 | |||
88 | #include "old_macros.h" |
||
89 | |||
395 | hbuss | 90 | #include "_Settings.h" |
1 | ingob | 91 | #include "printf_P.h" |
92 | #include "timer0.h" |
||
93 | #include "uart.h" |
||
94 | #include "analog.h" |
||
95 | #include "twimaster.h" |
||
96 | #include "menu.h" |
||
97 | #include "rc.h" |
||
98 | #include "fc.h" |
||
99 | #include "gps.h" |
||
304 | ingob | 100 | #include "spi.h" |
921 | hbuss | 101 | #include "led.h" |
1 | ingob | 102 | |
103 | #ifndef EEMEM |
||
104 | #define EEMEM __attribute__ ((section (".eeprom"))) |
||
105 | #endif |
||
106 | |||
107 | #define DEBUG_DISPLAY_INTERVALL 123 // in ms |
||
108 | |||
109 | |||
110 | #define DELAY_US(x) ((unsigned int)( (x) * 1e-6 * F_CPU )) |
||
1058 | killagreg | 111 | |
1 | ingob | 112 | #endif //_MAIN_H |
113 | |||
114 | |||
115 | |||
116 | |||
117 | |||
118 |