Rev 838 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 838 | Rev 840 | ||
---|---|---|---|
Line 106... | Line 106... | ||
106 | @post - |
106 | @post - |
107 | @author H. Buss / I. Busker |
107 | @author H. Buss / I. Busker |
108 | **************************************************************************** */ |
108 | **************************************************************************** */ |
109 | void MotorControl(void) |
109 | void MotorControl(void) |
110 | { |
110 | { |
111 | static unsigned int NotGasZeit; |
111 | static unsigned int NotGasZeit; |
112 | static unsigned char delay_neutral = 0; |
112 | static unsigned char delay_neutral = 0; |
113 | static unsigned char delay_einschalten = 0,delay_ausschalten = 0; |
113 | static unsigned char delay_einschalten = 0,delay_ausschalten = 0; |
114 | static unsigned int modell_fliegt = 0; |
114 | static unsigned int modell_fliegt = 0; |
115 | 115 | ||
116 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
116 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
117 | // Gaswert ermitteln |
117 | // Gaswert ermitteln |
118 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
118 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
119 | GasMischanteil = PPM_in[EE_Parameter.Kanalbelegung[K_GAS]] + 120; |
119 | GasMischanteil = PPM_in[EE_Parameter.Kanalbelegung[K_GAS]] + 120; |
120 | if(GasMischanteil < 0) |
120 | if(GasMischanteil < 0) |
Line 127... | Line 127... | ||
127 | 127 | ||
128 | if(SenderOkay < 100) |
128 | if(SenderOkay < 100) |
129 | { |
129 | { |
130 | if(!PcZugriff) |
130 | if(!PcZugriff) |
131 | { |
131 | { |
132 | if(BeepMuster == 0xffff) |
132 | if(BeepMuster == 0xffff) |
133 | { |
133 | { |
134 | beeptime = 15000; |
134 | beeptime = 15000; |
135 | BeepMuster = 0x0c00; |
135 | BeepMuster = 0x0c00; |
136 | } |
136 | } |
Line 156... | Line 156... | ||
156 | { |
156 | { |
157 | MotorenEin = 0; |
157 | MotorenEin = 0; |
158 | } |
158 | } |
159 | } |
159 | } |
160 | else |
160 | else |
161 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
- | |
162 | // Emfang gut |
- | |
163 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
- | |
164 | if(SenderOkay > 140) |
- | |
165 | { |
- | |
166 | Notlandung = 0; |
- | |
167 | NotGasZeit = 200 * 50; //EE_Parameter.NotGasZeit * 50; |
- | |
168 | if(GasMischanteil > 40) |
- | |
169 | { |
- | |
170 | if(modell_fliegt < 0xffff) |
- | |
171 | { |
161 | { |
172 | modell_fliegt++; |
- | |
173 | } |
- | |
174 | } |
- | |
175 | - | ||
176 | if((GasMischanteil > 200) && MotorenEin == 0) |
- | |
177 | { |
- | |
178 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
- | |
179 | // auf Nullwerte kalibrieren |
- | |
180 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
- | |
181 | if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 75) // Neutralwerte |
- | |
182 | { |
- | |
183 | if(++delay_neutral > 50) // nicht sofort |
- | |
184 | { |
- | |
185 | MotorenEin = 0; |
- | |
186 | delay_neutral = 0; |
- | |
187 | modell_fliegt = 0; |
- | |
188 | if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung aktiviert? |
- | |
189 | { |
- | |
190 | if((AdWertAirPressure_Raw > 950) || (AdWertAirPressure_Raw < 750)) |
- | |
191 | { |
- | |
192 | SucheLuftruckOffset(); |
- | |
193 | } |
- | |
194 | } |
- | |
195 | ReadParameterSet(GetActiveParamSetNumber(), (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
- | |
196 | SetNeutral(); |
- | |
197 | } |
- | |
198 | } |
- | |
199 | else delay_neutral = 0; |
- | |
200 | } |
- | |
201 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
162 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
202 | // Gas ist unten |
163 | // Emfang gut |
203 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
164 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
204 | if(GasMischanteil < 35) |
165 | if(SenderOkay > 140) |
205 | { |
166 | { |
206 | // Starten |
167 | Notlandung = 0; |
207 | if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] < -75) |
168 | NotGasZeit = 200 * 50; //EE_Parameter.NotGasZeit * 50; |
208 | { |
169 | if(GasMischanteil > 40) |
209 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
- | |
210 | // Einschalten |
170 | { |
211 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
- | |
212 | if(++delay_einschalten > 100) |
171 | if(modell_fliegt < 0xffff) |
213 | { |
172 | { |
214 | MotorenEin = 1; |
- | |
215 | modell_fliegt = 1; |
173 | modell_fliegt++; |
216 | delay_einschalten = 100; |
- | |
217 | } |
174 | } |
218 | } |
175 | } |
- | 176 | ||
219 | else |
177 | if((GasMischanteil > 200) && MotorenEin == 0) |
220 | { |
178 | { |
- | 179 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
|
- | 180 | // auf Nullwerte kalibrieren |
|
- | 181 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
|
- | 182 | if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 75) // Neutralwerte |
|
- | 183 | { |
|
- | 184 | if(++delay_neutral > 50) // nicht sofort |
|
- | 185 | { |
|
- | 186 | MotorenEin = 0; |
|
221 | delay_einschalten = 0; |
187 | delay_neutral = 0; |
- | 188 | modell_fliegt = 0; |
|
- | 189 | if((EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG)) // Höhenregelung aktiviert? |
|
- | 190 | { |
|
- | 191 | if((AdWertAirPressure_Raw > 950) || (AdWertAirPressure_Raw < 750)) |
|
- | 192 | { |
|
- | 193 | SucheLuftruckOffset(); |
|
222 | } |
194 | } |
- | 195 | } |
|
- | 196 | ReadParameterSet(GetActiveParamSetNumber(), (unsigned char *) &EE_Parameter.Kanalbelegung[0], STRUCT_PARAM_LAENGE); |
|
223 | //Auf Neutralwerte setzen |
197 | SetNeutral(); |
- | 198 | } |
|
- | 199 | } |
|
- | 200 | else delay_neutral = 0; |
|
- | 201 | } |
|
224 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
202 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
225 | // Auschalten |
203 | // Gas ist unten |
226 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
204 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
227 | if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 75) |
- | |
228 | { |
- | |
229 | if(++delay_ausschalten > 50) // nicht sofort |
- | |
230 | { |
- | |
231 | MotorenEin = 0; |
205 | if(GasMischanteil < 35) |
232 | modell_fliegt = 0; |
- | |
233 | delay_ausschalten = 50; |
- | |
234 | } |
- | |
235 | } |
- | |
236 | else |
- | |
237 | { |
206 | { |
- | 207 | // Starten |
|
- | 208 | if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] < -75) |
|
- | 209 | { |
|
- | 210 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
|
- | 211 | // Einschalten |
|
- | 212 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
|
- | 213 | if(++delay_einschalten > 100) |
|
- | 214 | { |
|
- | 215 | MotorenEin = 1; |
|
- | 216 | modell_fliegt = 1; |
|
- | 217 | delay_einschalten = 100; |
|
- | 218 | } |
|
- | 219 | } |
|
- | 220 | else |
|
- | 221 | { |
|
238 | delay_ausschalten = 0; |
222 | delay_einschalten = 0; |
- | 223 | } |
|
- | 224 | //Auf Neutralwerte setzen |
|
- | 225 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
|
239 | } |
226 | // Auschalten |
- | 227 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
|
- | 228 | if(PPM_in[EE_Parameter.Kanalbelegung[K_GIER]] > 75) |
|
- | 229 | { |
|
- | 230 | if(++delay_ausschalten > 50) // nicht sofort |
|
- | 231 | { |
|
- | 232 | MotorenEin = 0; |
|
- | 233 | modell_fliegt = 0; |
|
- | 234 | delay_ausschalten = 50; |
|
- | 235 | } |
|
- | 236 | } |
|
- | 237 | else |
|
- | 238 | { |
|
- | 239 | delay_ausschalten = 0; |
|
- | 240 | } |
|
- | 241 | } |
|
240 | } |
242 | } |
241 | } |
243 | } |
242 | } |
244 | } |
Line 243... | Line 245... | ||
243 | 245 | ||
244 | 246 |