Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2169 | - | 1 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2 | // + www.MikroKopter.com |
||
3 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
4 | // + Software Nutzungsbedingungen (english version: see below) |
||
5 | // + der Fa. HiSystems GmbH, Flachsmeerstrasse 2, 26802 Moormerland - nachfolgend Lizenzgeber genannt - |
||
6 | // + Der Lizenzgeber räumt dem Kunden ein nicht-ausschließliches, zeitlich und räumlich* unbeschränktes Recht ein, die im den |
||
7 | // + Mikrocontroller verwendete Firmware für die Hardware Flight-Ctrl, Navi-Ctrl, BL-Ctrl, MK3Mag & PC-Programm MikroKopter-Tool |
||
8 | // + - nachfolgend Software genannt - nur für private Zwecke zu nutzen. |
||
9 | // + Der Einsatz dieser Software ist nur auf oder mit Produkten des Lizenzgebers zulässig. |
||
10 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
11 | // + Die vom Lizenzgeber gelieferte Software ist urheberrechtlich geschützt. Alle Rechte an der Software sowie an sonstigen im |
||
12 | // + Rahmen der Vertragsanbahnung und Vertragsdurchführung überlassenen Unterlagen stehen im Verhältnis der Vertragspartner ausschließlich dem Lizenzgeber zu. |
||
13 | // + Die in der Software enthaltenen Copyright-Vermerke, Markenzeichen, andere Rechtsvorbehalte, Seriennummern sowie |
||
14 | // + sonstige der Programmidentifikation dienenden Merkmale dürfen vom Kunden nicht verändert oder unkenntlich gemacht werden. |
||
15 | // + Der Kunde trifft angemessene Vorkehrungen für den sicheren Einsatz der Software. Er wird die Software gründlich auf deren |
||
16 | // + Verwendbarkeit zu dem von ihm beabsichtigten Zweck testen, bevor er diese operativ einsetzt. |
||
17 | // + Die Haftung des Lizenzgebers wird - soweit gesetzlich zulässig - begrenzt in Höhe des typischen und vorhersehbaren |
||
18 | // + Schadens. Die gesetzliche Haftung bei Personenschäden und nach dem Produkthaftungsgesetz bleibt unberührt. Dem Lizenzgeber steht jedoch der Einwand |
||
19 | // + des Mitverschuldens offen. |
||
20 | // + Der Kunde trifft angemessene Vorkehrungen für den Fall, dass die Software ganz oder teilweise nicht ordnungsgemäß arbeitet. |
||
21 | // + Er wird die Software gründlich auf deren Verwendbarkeit zu dem von ihm beabsichtigten Zweck testen, bevor er diese operativ einsetzt. |
||
22 | // + Der Kunde wird er seine Daten vor Einsatz der Software nach dem Stand der Technik sichern. |
||
23 | // + Der Kunde ist darüber unterrichtet, dass der Lizenzgeber seine Daten im zur Vertragsdurchführung erforderlichen Umfang |
||
24 | // + und auf Grundlage der Datenschutzvorschriften erhebt, speichert, verarbeitet und, sofern notwendig, an Dritte übermittelt. |
||
25 | // + *) Die räumliche Nutzung bezieht sich nur auf den Einsatzort, nicht auf die Reichweite der programmierten Software. |
||
26 | // + #### ENDE DER NUTZUNGSBEDINGUNGEN ####' |
||
27 | // + Hinweis: Informationen über erweiterte Nutzungsrechte (wie z.B. Nutzung für nicht-private Zwecke) sind auf Anfrage per Email an info(@)hisystems.de verfügbar. |
||
28 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
29 | // + Software LICENSING TERMS |
||
30 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
31 | // + of HiSystems GmbH, Flachsmeerstrasse 2, 26802 Moormerland, Germany - the Licensor - |
||
32 | // + The Licensor grants the customer a non-exclusive license to use the microcontroller firmware of the Flight-Ctrl, Navi-Ctrl, BL-Ctrl, and MK3Mag hardware |
||
33 | // + (the Software) exclusively for private purposes. The License is unrestricted with respect to time and territory*. |
||
34 | // + The Software may only be used with the Licensor's products. |
||
35 | // + The Software provided by the Licensor is protected by copyright. With respect to the relationship between the parties to this |
||
36 | // + agreement, all rights pertaining to the Software and other documents provided during the preparation and execution of this |
||
37 | // + agreement shall be the property of the Licensor. |
||
38 | // + The information contained in the Software copyright notices, trademarks, other legal reservations, serial numbers and other |
||
39 | // + features that can be used to identify the program may not be altered or defaced by the customer. |
||
40 | // + The customer shall be responsible for taking reasonable precautions |
||
41 | // + for the safe use of the Software. The customer shall test the Software thoroughly regarding its suitability for the |
||
42 | // + intended purpose before implementing it for actual operation. The Licensor's liability shall be limited to the extent of typical and |
||
43 | // + foreseeable damage to the extent permitted by law, notwithstanding statutory liability for bodily injury and product |
||
44 | // + liability. However, the Licensor shall be entitled to the defense of contributory negligence. |
||
45 | // + The customer will take adequate precautions in the case, that the software is not working properly. The customer will test |
||
46 | // + the software for his purpose before any operational usage. The customer will backup his data before using the software. |
||
47 | // + The customer understands that the Licensor collects, stores and processes, and, where required, forwards, customer data |
||
48 | // + to third parties to the extent necessary for executing the agreement, subject to applicable data protection and privacy regulations. |
||
49 | // + *) The territory aspect only refers to the place where the Software is used, not its programmed range. |
||
50 | // + #### END OF LICENSING TERMS #### |
||
51 | // + Note: For information on license extensions (e.g. commercial use), please contact us at info(@)hisystems.de. |
||
52 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
53 | #include "main.h" |
||
54 | unsigned char DisableRcOffBeeping = 0; |
||
55 | unsigned char PlatinenVersion = 10; |
||
56 | unsigned char BattLowVoltageWarning = 94; |
||
57 | unsigned int FlugMinuten = 0,FlugMinutenGesamt = 0; |
||
58 | unsigned int FlugSekunden = 0; |
||
59 | pVoidFnct_pVoidFnctChar_const_fmt _printf_P; |
||
60 | unsigned char FoundMotors = 0; |
||
61 | unsigned char JetiBeep = 0; // to allow any Morse-Beeping of the Jeti-Box |
||
62 | |||
63 | void PrintLine(void) |
||
64 | { |
||
65 | printf("\n\r==================================="); |
||
66 | } |
||
67 | |||
68 | |||
69 | void CalMk3Mag(void) |
||
70 | { |
||
71 | static unsigned char stick = 1; |
||
72 | if(PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] > -20) stick = 0; |
||
73 | if((PPM_in[EE_Parameter.Kanalbelegung[K_NICK]] < -70) && !stick) |
||
74 | { |
||
75 | stick = 1; |
||
76 | WinkelOut.CalcState++; |
||
77 | if(WinkelOut.CalcState > 4) |
||
78 | { |
||
79 | // WinkelOut.CalcState = 0; // in Uart.c |
||
80 | beeptime = 1000; |
||
81 | } |
||
82 | else Piep(WinkelOut.CalcState,150); |
||
83 | } |
||
84 | DebugOut.Analog[19] = WinkelOut.CalcState; |
||
85 | } |
||
86 | |||
87 | |||
88 | void LipoDetection(unsigned char print) |
||
89 | { |
||
90 | #define MAX_CELL_VOLTAGE 43 // max cell volatage for LiPO |
||
91 | unsigned int timer, cells; |
||
92 | if(print) printf("\n\rBatt:"); |
||
93 | if(EE_Parameter.UnterspannungsWarnung < 50) // automatische Zellenerkennung |
||
94 | { |
||
95 | timer = SetDelay(500); |
||
96 | if(print) while (!CheckDelay(timer)); |
||
97 | // up to 6s LiPo, less than 2s is technical impossible |
||
98 | for(cells = 2; cells < 7; cells++) |
||
99 | { |
||
100 | if(UBat < cells * MAX_CELL_VOLTAGE) break; |
||
101 | } |
||
102 | |||
103 | BattLowVoltageWarning = cells * EE_Parameter.UnterspannungsWarnung; |
||
104 | if(print) |
||
105 | { |
||
106 | Piep(cells, 200); |
||
107 | printf(" %d Cells ", cells); |
||
108 | } |
||
109 | } |
||
110 | else BattLowVoltageWarning = EE_Parameter.UnterspannungsWarnung; |
||
111 | if(print) printf(" Low warning: %d.%d",BattLowVoltageWarning/10,BattLowVoltageWarning%10); |
||
112 | } |
||
113 | |||
114 | //############################################################################ |
||
115 | //Hauptprogramm |
||
116 | int main (void) |
||
117 | //############################################################################ |
||
118 | { |
||
119 | unsigned int timer,i,timer2 = 0, timerPolling; |
||
120 | |||
121 | DDRB = 0x00; |
||
122 | PORTB = 0x00; |
||
123 | for(timer = 0; timer < 1000; timer++); // verzögern |
||
124 | #if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
||
125 | PlatinenVersion = 21; |
||
126 | #else |
||
127 | if(PINB & 0x01) |
||
128 | { |
||
129 | if(PINB & 0x02) PlatinenVersion = 13; |
||
130 | else PlatinenVersion = 11; |
||
131 | } |
||
132 | else |
||
133 | { |
||
134 | if(PINB & 0x02) PlatinenVersion = 20; |
||
135 | else PlatinenVersion = 10; |
||
136 | } |
||
137 | #endif |
||
138 | DDRC = 0x81; // SCL |
||
139 | DDRC |=0x40; // HEF4017 Reset |
||
140 | PORTC = 0xff; // Pullup SDA |
||
141 | DDRB = 0x1B; // LEDs und Druckoffset |
||
142 | PORTB = 0x01; // LED_Rot |
||
143 | DDRD = 0x3E; // Speaker & TXD & J3 J4 J5 |
||
144 | PORTD = 0x47; // LED |
||
145 | HEF4017Reset_ON; |
||
146 | MCUSR &=~(1<<WDRF); |
||
147 | WDTCSR |= (1<<WDCE)|(1<<WDE); |
||
148 | WDTCSR = 0; |
||
149 | |||
150 | beeptime = 2500; |
||
151 | StickGier = 0; PPM_in[K_GAS] = 0; StickRoll = 0; StickNick = 0; |
||
152 | if(PlatinenVersion >= 20) GIER_GRAD_FAKTOR = 1220; else GIER_GRAD_FAKTOR = 1291; // unterschiedlich für ME und ENC |
||
153 | ROT_OFF; |
||
154 | |||
155 | Timer_Init(); |
||
156 | TIMER2_Init(); |
||
157 | UART_Init(); |
||
158 | rc_sum_init(); |
||
159 | ADC_Init(); |
||
160 | I2C_Init(1); |
||
161 | SPI_MasterInit(); |
||
162 | Capacity_Init(); |
||
163 | LIBFC_Init(); |
||
164 | GRN_ON; |
||
165 | sei(); |
||
166 | ParamSet_Init(); |
||
167 | |||
168 | |||
169 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
170 | // + Check connected BL-Ctrls |
||
171 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
172 | // Check connected BL-Ctrls |
||
173 | BLFlags |= BLFLAG_READ_VERSION; |
||
174 | motor_read = 0; // read the first I2C-Data |
||
175 | SendMotorData(); |
||
176 | timer = SetDelay(500); |
||
177 | while(!(BLFlags & BLFLAG_TX_COMPLETE) && !CheckDelay(timer)); //wait for complete transfer |
||
178 | |||
179 | printf("\n\rFound BL-Ctrl: "); |
||
180 | timer = SetDelay(4000); |
||
181 | for(i=0; i < MAX_MOTORS; i++) |
||
182 | { |
||
183 | SendMotorData(); |
||
184 | while(!(BLFlags & BLFLAG_TX_COMPLETE) && !CheckDelay(timer)); //wait for complete transfer |
||
185 | if(Mixer.Motor[i][0] > 0) // wait max 4 sec for the BL-Ctrls to wake up |
||
186 | { |
||
187 | while(!CheckDelay(timer) && !(Motor[i].State & MOTOR_STATE_PRESENT_MASK) ) |
||
188 | { |
||
189 | SendMotorData(); |
||
190 | while(!(BLFlags & BLFLAG_TX_COMPLETE) && !CheckDelay(timer)); //wait for complete transfer |
||
191 | } |
||
192 | } |
||
193 | if(Motor[i].State & MOTOR_STATE_PRESENT_MASK) |
||
194 | { |
||
195 | printf("%d",i+1); |
||
196 | FoundMotors++; |
||
197 | // if(Motor[i].Version & MOTOR_STATE_NEW_PROTOCOL_MASK) printf("(new) "); |
||
198 | } |
||
199 | } |
||
200 | for(i=0; i < MAX_MOTORS; i++) |
||
201 | { |
||
202 | if(!(Motor[i].State & MOTOR_STATE_PRESENT_MASK) && Mixer.Motor[i][0] > 0) |
||
203 | { |
||
204 | printf("\n\r\n\r!! MISSING BL-CTRL: %d !!",i+1); |
||
205 | ServoActive = 2; // just in case the FC would be used as camera-stabilizer |
||
206 | } |
||
207 | Motor[i].State &= ~MOTOR_STATE_ERROR_MASK; // clear error counter |
||
208 | } |
||
209 | PrintLine();// ("\n\r==================================="); |
||
210 | |||
211 | |||
212 | if(RequiredMotors < FoundMotors) VersionInfo.HardwareError[1] |= FC_ERROR1_MIXER; |
||
213 | |||
214 | //if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
||
215 | { |
||
216 | printf("\n\rCalibrating pressure sensor.."); |
||
217 | timer = SetDelay(1000); |
||
218 | SucheLuftruckOffset(); |
||
219 | while (!CheckDelay(timer)); |
||
220 | printf("OK\n\r"); |
||
221 | } |
||
222 | |||
223 | SetNeutral(0); |
||
224 | |||
225 | ROT_OFF; |
||
226 | |||
227 | beeptime = 2000; |
||
228 | ExternControl.Digital[0] = 0x55; |
||
229 | |||
230 | |||
231 | FlugMinuten = (unsigned int)GetParamByte(PID_FLIGHT_MINUTES) * 256 + (unsigned int)GetParamByte(PID_FLIGHT_MINUTES + 1); |
||
232 | FlugMinutenGesamt = (unsigned int)GetParamByte(PID_FLIGHT_MINUTES_TOTAL) * 256 + (unsigned int)GetParamByte(PID_FLIGHT_MINUTES_TOTAL + 1); |
||
233 | |||
234 | if((FlugMinutenGesamt == 0xFFFF) || (FlugMinuten == 0xFFFF)) |
||
235 | { |
||
236 | FlugMinuten = 0; |
||
237 | FlugMinutenGesamt = 0; |
||
238 | } |
||
239 | printf("\n\rFlight-time %u min Total:%u min", FlugMinuten, FlugMinutenGesamt); |
||
240 | |||
241 | LcdClear(); |
||
242 | I2CTimeout = 5000; |
||
243 | WinkelOut.Orientation = 1; |
||
244 | LipoDetection(1); |
||
245 | LIBFC_ReceiverInit(EE_Parameter.Receiver); |
||
246 | PrintLine();// ("\n\r==================================="); |
||
247 | //SpektrumBinding(); |
||
248 | timer = SetDelay(2000); |
||
249 | timerPolling = SetDelay(250); |
||
250 | |||
251 | Debug(ANSI_CLEAR "FC-Start!\n\rFlugzeit: %d min", FlugMinutenGesamt); // Note: this won't waste flash memory, if #DEBUG is not active |
||
252 | DebugOut.Status[0] = 0x01 | 0x02; |
||
253 | JetiBeep = 0; |
||
254 | if(EE_Parameter.ExtraConfig & CFG_NO_RCOFF_BEEPING) DisableRcOffBeeping = 1; |
||
255 | while (1) |
||
256 | { |
||
257 | if(ReceiverUpdateModeActive) while (1) PORTC &= ~(1<<7); // Beeper off |
||
258 | |||
259 | //GRN_ON; |
||
260 | if(UpdateMotor && AdReady) // ReglerIntervall |
||
261 | { |
||
262 | //GRN_OFF; |
||
263 | UpdateMotor=0; |
||
264 | if(WinkelOut.CalcState) CalMk3Mag(); |
||
265 | else MotorRegler(); |
||
266 | SendMotorData(); |
||
267 | ROT_OFF; |
||
268 | if(SenderOkay) { SenderOkay--; /*VersionInfo.HardwareError[1] &= ~FC_ERROR1_PPM;*/ } |
||
269 | else |
||
270 | { |
||
271 | TIMSK1 |= _BV(ICIE1); // enable PPM-Input |
||
272 | PPM_in[0] = 0; // set RSSI to zero on data timeout |
||
273 | VersionInfo.HardwareError[1] |= FC_ERROR1_PPM; |
||
274 | } |
||
275 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
276 | //if(HoehenReglerAktiv && NaviDataOkay && SenderOkay < 160 && SenderOkay > 10 && FromNaviCtrl_Value.SerialDataOkay > 220) SenderOkay = 160; |
||
277 | //if(HoehenReglerAktiv && NaviDataOkay && SenderOkay < 101 && SenderOkay > 10 && FromNaviCtrl_Value.SerialDataOkay > 1) SenderOkay = 101; |
||
278 | //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
279 | if(!--I2CTimeout || MissingMotor) |
||
280 | { |
||
281 | if(!I2CTimeout) |
||
282 | { |
||
283 | I2C_Reset(); |
||
284 | I2CTimeout = 5; |
||
285 | DebugOut.Analog[28]++; // I2C-Error |
||
286 | VersionInfo.HardwareError[1] |= FC_ERROR1_I2C; |
||
287 | DebugOut.Status[1] |= 0x02; // BL-Error-Status |
||
288 | } |
||
289 | if((BeepMuster == 0xffff) && MotorenEin) |
||
290 | { |
||
291 | beeptime = 25000; |
||
292 | BeepMuster = 0x0080; |
||
293 | } |
||
294 | } |
||
295 | else |
||
296 | { |
||
297 | ROT_OFF; |
||
298 | } |
||
299 | LIBFC_Polling(); |
||
300 | |||
301 | if(!UpdateMotor) |
||
302 | { |
||
303 | //#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
||
304 | if(NewSBusData) ProcessSBus(); |
||
305 | else |
||
306 | //#endif |
||
307 | { |
||
308 | if(CalculateServoSignals) CalculateServo(); |
||
309 | DatenUebertragung(); |
||
310 | BearbeiteRxDaten(); |
||
311 | if(CheckDelay(timer)) |
||
312 | { |
||
313 | static unsigned char second; |
||
314 | timer += 20; // 20 ms interval |
||
315 | #if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
||
316 | if(EE_Parameter.Receiver == RECEIVER_HOTT) HoTT_Menu(); |
||
317 | #endif |
||
318 | if(MissingMotor) |
||
319 | { |
||
320 | VersionInfo.HardwareError[1] |= FC_ERROR1_BL_MISSING; |
||
321 | DebugOut.Status[1] |= 0x02; // BL-Error-Status |
||
322 | } |
||
323 | else |
||
324 | { |
||
325 | if(!beeptime) |
||
326 | { |
||
327 | if(I2CTimeout > 6) DebugOut.Status[1] &= ~0x02; // BL-Error-Status |
||
328 | } |
||
329 | } |
||
330 | if(DisableRcOffBeeping) if(SenderOkay > 150) { DisableRcOffBeeping = 0; beeptime = 5000;}; |
||
331 | if(PcZugriff) PcZugriff--; |
||
332 | else |
||
333 | { |
||
334 | ExternControl.Config = 0; |
||
335 | ExternStickNick = 0; |
||
336 | ExternStickRoll = 0; |
||
337 | ExternStickGier = 0; |
||
338 | if(!SenderOkay) |
||
339 | { |
||
340 | if(BeepMuster == 0xffff && DisableRcOffBeeping != 2) |
||
341 | { |
||
342 | beeptime = 15000; |
||
343 | BeepMuster = 0x0c00; |
||
344 | if(DisableRcOffBeeping) DisableRcOffBeeping = 2; |
||
345 | } |
||
346 | } |
||
347 | } |
||
348 | if(NaviDataOkay > 200) |
||
349 | { |
||
350 | NaviDataOkay--; |
||
351 | VersionInfo.HardwareError[1] &= ~FC_ERROR1_SPI_RX; |
||
352 | } |
||
353 | else |
||
354 | { |
||
355 | if(NC_Version.Compatible) |
||
356 | { |
||
357 | VersionInfo.HardwareError[1] |= FC_ERROR1_SPI_RX; |
||
358 | NC_ErrorCode = 9; // "ERR: no NC communication" |
||
359 | if(BeepMuster == 0xffff && MotorenEin) |
||
360 | { |
||
361 | beeptime = 15000; |
||
362 | BeepMuster = 0xA800; |
||
363 | } |
||
364 | } |
||
365 | GPS_Nick = 0; |
||
366 | GPS_Roll = 0; |
||
367 | GPS_Aid_StickMultiplikator = 0; |
||
368 | GPSInfo.Flags = 0; |
||
369 | FromNaviCtrl.AccErrorN = 0; |
||
370 | FromNaviCtrl.AccErrorR = 0; |
||
371 | FromNaviCtrl.CompassValue = -1; |
||
372 | NaviDataOkay = 0; |
||
373 | } |
||
374 | if(UBat < BattLowVoltageWarning) |
||
375 | { |
||
376 | FC_StatusFlags |= FC_STATUS_LOWBAT; |
||
377 | if(BeepMuster == 0xffff) |
||
378 | { |
||
379 | beeptime = 6000; |
||
380 | BeepMuster = 0x0300; |
||
381 | } |
||
382 | } |
||
383 | else if(!beeptime) FC_StatusFlags &= ~FC_STATUS_LOWBAT; |
||
384 | |||
385 | SPI_StartTransmitPacket(); |
||
386 | SendSPI = 4; |
||
387 | // +++++++++++++++++++++++++++++++++ |
||
388 | // Sekundentakt |
||
389 | if(++second == 49) |
||
390 | { |
||
391 | second = 0; |
||
392 | if(FC_StatusFlags & FC_STATUS_FLY) FlugSekunden++; |
||
393 | else |
||
394 | { |
||
395 | timer2 = 1450; // 0,5 Minuten aufrunden |
||
396 | if(StartLuftdruck < Luftdruck) StartLuftdruck++; |
||
397 | else |
||
398 | if(StartLuftdruck > Luftdruck) StartLuftdruck--; |
||
399 | } |
||
400 | } |
||
401 | // +++++++++++++++++++++++++++++++++ |
||
402 | if(++timer2 == 2930) // eine Minute |
||
403 | { |
||
404 | timer2 = 0; |
||
405 | FlugMinuten++; |
||
406 | FlugMinutenGesamt++; |
||
407 | SetParamByte(PID_FLIGHT_MINUTES,FlugMinuten / 256); |
||
408 | SetParamByte(PID_FLIGHT_MINUTES+1,FlugMinuten % 256); |
||
409 | SetParamByte(PID_FLIGHT_MINUTES_TOTAL,FlugMinutenGesamt / 256); |
||
410 | SetParamByte(PID_FLIGHT_MINUTES_TOTAL+1,FlugMinutenGesamt % 256); |
||
411 | timer = SetDelay(20); // falls "timer += 20;" mal nicht geht |
||
412 | } |
||
413 | } |
||
414 | LED_Update(); |
||
415 | Capacity_Update(); |
||
416 | } //else DebugOut.Analog[26]++; |
||
417 | } |
||
418 | } |
||
419 | if(!SendSPI) { SPI_TransmitByte(); } |
||
420 | } |
||
421 | return (1); |
||
422 | } |
||
423 | //DebugOut.Analog[16] |
||
424 |