Rev 1702 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1702 | Rev 1728 | ||
---|---|---|---|
Line 22... | Line 22... | ||
22 | signed char ExpandBaro = 0; |
22 | signed char ExpandBaro = 0; |
23 | volatile int VarioMeter = 0; |
23 | volatile int VarioMeter = 0; |
24 | volatile unsigned int ZaehlMessungen = 0; |
24 | volatile unsigned int ZaehlMessungen = 0; |
25 | unsigned char AnalogOffsetNick = 115,AnalogOffsetRoll = 115,AnalogOffsetGier = 115; |
25 | unsigned char AnalogOffsetNick = 115,AnalogOffsetRoll = 115,AnalogOffsetGier = 115; |
26 | volatile unsigned char AdReady = 1; |
26 | volatile unsigned char AdReady = 1; |
27 | float NeutralAccZ_float; |
27 | // float NeutralAccZ_float; // MartinR : wozu ?? |
28 | //####################################################################################### |
28 | //####################################################################################### |
29 | // |
29 | // |
30 | void ADC_Init(void) |
30 | void ADC_Init(void) |
31 | //####################################################################################### |
31 | //####################################################################################### |
32 | { |
32 | { |
Line 109... | Line 109... | ||
109 | // |
109 | // |
110 | ISR(ADC_vect) |
110 | ISR(ADC_vect) |
111 | //####################################################################################### |
111 | //####################################################################################### |
112 | { |
112 | { |
113 | static unsigned char kanal=0,state = 0; |
113 | static unsigned char kanal=0,state = 0; |
114 | static signed char subcount = 0; |
114 | // static signed char subcount = 0; |
115 | static signed int gier1, roll1, nick1, nick_filter, roll_filter; |
115 | static signed int gier1, roll1, nick1, nick_filter, roll_filter; |
116 | static signed int accy, accx; |
116 | static signed int accy, accx; |
117 | static long tmpLuftdruck = 0; |
117 | static long tmpLuftdruck = 0; |
118 | static char messanzahl_Druck = 0; |
118 | static char messanzahl_Druck = 0; |
119 | switch(state++) |
119 | switch(state++) |
Line 152... | Line 152... | ||
152 | UBat = (3 * UBat + ADC / 3) / 4; |
152 | UBat = (3 * UBat + ADC / 3) / 4; |
153 | kanal = AD_ACC_Z; |
153 | kanal = AD_ACC_Z; |
154 | break; |
154 | break; |
155 | case 8: |
155 | case 8: |
156 | AdWertAccHoch = (signed int) ADC - NeutralAccZ; |
156 | AdWertAccHoch = (signed int) ADC - NeutralAccZ; |
- | 157 | ||
- | 158 | /* // MartinR: deaktivieren ???? |
|
- | 159 | |
|
157 | if(AdWertAccHoch > 1) |
160 | if(AdWertAccHoch > 1) |
158 | { |
161 | { |
159 | if(NeutralAccZ < 750) |
162 | if(NeutralAccZ < 750) |
160 | { |
163 | { |
161 | subcount += 5; |
164 | subcount += 5; |
Line 170... | Line 173... | ||
170 | subcount -= 5; |
173 | subcount -= 5; |
171 | if(modell_fliegt < 500) subcount -= 10; |
174 | if(modell_fliegt < 500) subcount -= 10; |
172 | if(subcount < -100) { NeutralAccZ--; subcount += 100;} |
175 | if(subcount < -100) { NeutralAccZ--; subcount += 100;} |
173 | } |
176 | } |
174 | } |
177 | } |
- | 178 | |
|
- | 179 | */ // MartinR: deaktivieren Ende |
|
- | 180 | ||
- | 181 | ||
175 | messanzahl_AccHoch = 1; |
182 | messanzahl_AccHoch = 1; |
176 | Aktuell_az = ADC; |
183 | Aktuell_az = ADC; |
177 | Mess_Integral_Hoch += AdWertAccHoch; // Integrieren |
184 | Mess_Integral_Hoch += AdWertAccHoch; // Integrieren |
178 | Mess_Integral_Hoch -= Mess_Integral_Hoch / 1024; // dämfen |
185 | Mess_Integral_Hoch -= Mess_Integral_Hoch / 1024; // dämfen |
179 | kanal = AD_DRUCK; |
186 | kanal = AD_DRUCK; |