Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2003 | - | 1 | #include "libfc.h" |
2 | #include "printf_P.h" |
||
3 | #include "main.h" |
||
4 | #include "spi.h" |
||
5 | #include "capacity.h" |
||
6 | |||
7 | #if ((defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) && defined(WITH_HOTTMENU)) |
||
8 | #warning : "### with Hottmenu ###" |
||
9 | |||
10 | #define HoTT_printf(format, args...) { _printf_P(&LIBFC_HoTT_Putchar, PSTR(format) , ## args);} |
||
11 | #define HoTT_printfxy(x,y,format, args...) { LIBFC_HoTT_SetPos(y * 21 + x); _printf_P(&LIBFC_HoTT_Putchar, PSTR(format) , ## args);} |
||
12 | #define HoTT_printfxy_INV(x,y,format, args...) { LIBFC_HoTT_SetPos(y * 21 + x); _printf_P(&LIBFC_HoTT_Putchar_INV, PSTR(format) , ## args);} |
||
13 | #define HoTT_printfxy_BLINK(x,y,format, args...) { LIBFC_HoTT_SetPos(y * 21 + x); _printf_P(&LIBFC_HoTT_Putchar_BLINK, PSTR(format) , ## args);} |
||
14 | #define HoTT_printf_BLINK(format, args...) { _printf_P(&LIBFC_HoTT_Putchar_BLINK, PSTR(format) , ## args);} |
||
15 | #define HoTT_printf_INV(format, args...) { _printf_P(&LIBFC_HoTT_Putchar_INV, PSTR(format) , ## args);} |
||
16 | |||
17 | #define VOICE_MINIMALE_EINGANSSPANNUNG 16 |
||
18 | #define VOICE_BEEP 5 |
||
19 | #define HoTT_GRAD 96 |
||
20 | #define HoTT_LINKS 123 |
||
21 | #define HoTT_RECHTS 124 |
||
22 | #define HoTT_OBEN 125 |
||
23 | #define HoTT_UNTEN 126 |
||
24 | |||
25 | #define HOTT_KEY_RIGHT 1 |
||
26 | #define HOTT_KEY_DOWN 2 |
||
27 | #define HOTT_KEY_UP 4 |
||
28 | #define HOTT_KEY_SET 6 |
||
29 | #define HOTT_KEY_LEFT 8 |
||
30 | #endif |
||
31 | |||
32 | #if ((defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))) |
||
33 | GPSPacket_t GPSPacket; |
||
34 | VarioPacket_t VarioPacket; |
||
35 | ASCIIPacket_t ASCIIPacket; |
||
36 | ElectricAirPacket_t ElectricAirPacket; |
||
37 | HoTTGeneral_t HoTTGeneral; |
||
38 | int HoTTVarioMeter = 0; |
||
39 | |||
40 | const char PROGMEM NC_ERROR_TEXT[MAX_ERR_NUMBER][17] = |
||
41 | { |
||
42 | //0123456789123456 |
||
43 | "No Error \0", // 0 |
||
44 | "Not compatible \0", // 1 |
||
45 | "MK3Mag not compa\0", // 2 |
||
46 | "No FC communicat\0", // 3 |
||
47 | "MK3Mag communica\0", // 4 |
||
48 | "GPS communicatio\0", // 5 |
||
49 | "compass value \0", // 6 |
||
50 | "RC Signal lost \0", // 7 |
||
51 | "FC spi rx error \0", // 8 |
||
52 | "No NC communicat\0", // 9 |
||
53 | "FC Nick Gyro \0", // 10 |
||
54 | "FC Roll Gyro \0", // 11 |
||
55 | "FC Yaw Gyro \0", // 12 |
||
56 | "FC Nick ACC \0", // 13 |
||
57 | "FC Roll ACC \0", // 14 |
||
58 | "FC Z-ACC \0", // 15 |
||
59 | "Pressure sensor \0", // 16 |
||
60 | "I2C FC->BL-Ctrl \0", // 17 |
||
61 | "Bl Missing \0", // 18 |
||
62 | "Mixer Error \0", // 19 |
||
63 | "Carefree Error \0", // 20 |
||
64 | "GPS Fix lost \0", // 21 |
||
65 | "Magnet Error \0", // 22 |
||
66 | "Motor restart \0", // 23 |
||
67 | "BL Limitation \0" // 24 |
||
68 | }; |
||
69 | #endif |
||
70 | |||
71 | #ifndef WITH_HOTTMENU |
||
72 | unsigned char HoTT_Telemety(unsigned char packet_request) |
||
73 | { |
||
74 | return(0); |
||
75 | } |
||
76 | #endif |
||
77 | |||
78 | #if ((defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) && defined(WITH_HOTTMENU)) |
||
79 | #warning : "### with Hottmenu ###" |
||
80 | |||
81 | unsigned char MaxBlTempertaure = 0; |
||
82 | unsigned char MinBlTempertaure = 0; |
||
83 | unsigned char HottestBl = 0; |
||
84 | |||
85 | void GetHottestBl(void) |
||
86 | { |
||
87 | static unsigned char search = 0,tmp_max,tmp_min,who; |
||
88 | if(Motor[search].Temperature > tmp_max) { tmp_max = Motor[search].Temperature; who = search;} |
||
89 | else |
||
90 | if(Motor[search].Temperature) if(Motor[search].Temperature < tmp_min) tmp_min = Motor[search].Temperature; |
||
91 | if(++search > MAX_MOTORS) |
||
92 | { |
||
93 | search = 0; |
||
94 | if(tmp_min != 255) MinBlTempertaure = tmp_min; else MinBlTempertaure = 0; |
||
95 | MaxBlTempertaure = tmp_max; |
||
96 | HottestBl = who; |
||
97 | tmp_min = 255; |
||
98 | tmp_max = 0; |
||
99 | who = 0; |
||
100 | } |
||
101 | } |
||
102 | |||
103 | //--------------------------------------------------------------- |
||
104 | void Hott_ClearLine(unsigned char line) |
||
105 | { |
||
106 | HoTT_printfxy(0,line," "); |
||
107 | } |
||
108 | //--------------------------------------------------------------- |
||
109 | |||
110 | unsigned char HoTT_Waring(void) |
||
111 | { |
||
112 | if(FC_StatusFlags & FC_STATUS_LOWBAT) return(VOICE_MINIMALE_EINGANSSPANNUNG); |
||
113 | if(MotorenEin && NC_ErrorCode) return(VOICE_BEEP); |
||
114 | return(0); |
||
115 | } |
||
116 | |||
117 | //--------------------------------------------------------------- |
||
118 | void NC_Fills_HoTT_Telemety(void) |
||
119 | { |
||
120 | unsigned char *ptr; |
||
121 | unsigned char max = 0,i,z; |
||
122 | switch(FromNaviCtrl.Param.Byte[11]) |
||
123 | { |
||
124 | case HOTT_VARIO_PACKET_ID: |
||
125 | ptr = (unsigned char *) &VarioPacket; |
||
126 | max = sizeof(VarioPacket); |
||
127 | break; |
||
128 | case HOTT_GPS_PACKET_ID: |
||
129 | ptr = (unsigned char *) &GPSPacket; |
||
130 | max = sizeof(GPSPacket); |
||
131 | break; |
||
132 | case HOTT_ELECTRIC_AIR_PACKET_ID: |
||
133 | ptr = (unsigned char *) &ElectricAirPacket; |
||
134 | max = sizeof(ElectricAirPacket); |
||
135 | break; |
||
136 | case HOTT_GENERAL_PACKET_ID: |
||
137 | ptr = (unsigned char *) &HoTTGeneral; |
||
138 | max = sizeof(HoTTGeneral); |
||
139 | break; |
||
140 | } |
||
141 | z = FromNaviCtrl.Param.Byte[0]; // Data allocation |
||
142 | |||
143 | for(i=0; i < FromNaviCtrl.Param.Byte[1]; i++) |
||
144 | { |
||
145 | if(z >= max) break; |
||
146 | ptr[z] = FromNaviCtrl.Param.Byte[2+i]; |
||
147 | z++; |
||
148 | } |
||
149 | } |
||
150 | |||
151 | unsigned int BuildHoTT_Vario(void) |
||
152 | { |
||
153 | unsigned int tmp = 30000; |
||
154 | if(VarioCharacter == '+' || VarioCharacter == '-') |
||
155 | { |
||
156 | tmp = 30000 + (AltitudeSetpointTrimming * EE_Parameter.Hoehe_Verstaerkung) / 3; |
||
157 | if(tmp < 30000 && tmp > 30000 - 50) tmp = 30000 - 50; // weil es sonst erst bei < 0,5m/sek piept |
||
158 | } |
||
159 | else |
||
160 | if((VarioCharacter == ' ') && (FC_StatusFlags & FC_STATUS_FLY)) |
||
161 | { |
||
162 | tmp = 30000 + HoTTVarioMeter; |
||
163 | if(tmp > 30000) |
||
164 | { |
||
165 | if(tmp < 30000 + 100) tmp = 30000; |
||
166 | else tmp -= 100; |
||
167 | } |
||
168 | if(tmp < 30000) |
||
169 | { |
||
170 | if(tmp > 30000 - 100) tmp = 30000; |
||
171 | else tmp += 100; |
||
172 | } |
||
173 | } |
||
174 | else |
||
175 | if(VarioCharacter == '^') tmp = 30000 + FromNC_AltitudeSpeed * 10; |
||
176 | else |
||
177 | if(VarioCharacter == 'v') tmp = 30000 - FromNC_AltitudeSpeed * 10; |
||
178 | |||
179 | return(tmp); |
||
180 | } |
||
181 | |||
182 | |||
183 | //--------------------------------------------------------------- |
||
184 | unsigned char HoTT_Telemety(unsigned char packet_request) |
||
185 | { |
||
186 | switch(packet_request) |
||
187 | { |
||
188 | case HOTT_VARIO_PACKET_ID: |
||
189 | VarioPacket.Altitude = HoehenWert/100 + 500; |
||
190 | VarioPacket.m_sec = BuildHoTT_Vario(); |
||
191 | VarioPacket.m_3sec = VarioPacket.m_sec; |
||
192 | VarioPacket.m_10sec = VarioPacket.m_sec; |
||
193 | if (VarioPacket.Altitude < VarioPacket.MinAltitude) VarioPacket.MinAltitude = VarioPacket.Altitude; |
||
194 | if (VarioPacket.Altitude > VarioPacket.MaxAltitude) VarioPacket.MaxAltitude = VarioPacket.Altitude; |
||
195 | VarioPacket.WarnBeep = HoTT_Waring(); |
||
196 | HoTT_DataPointer = (unsigned char *) &VarioPacket; |
||
197 | return(sizeof(VarioPacket)); |
||
198 | break; |
||
199 | |||
200 | case HOTT_GPS_PACKET_ID: |
||
201 | GPSPacket.Altitude = HoehenWert/100 + 500; |
||
202 | // GPSPacket.Distance = GPSInfo.HomeDistance/10; // macht die NC |
||
203 | // GPSPacket.Heading = GPSInfo.HomeBearing/2; // macht die NC |
||
204 | // GPSPacket.Speed = (GPSInfo.Speed * 36) / 10; // macht die NC |
||
205 | GPSPacket.m_sec = BuildHoTT_Vario(); |
||
206 | GPSPacket.m_3sec = 120; |
||
207 | GPSPacket.m_10sec = 0; |
||
208 | GPSPacket.WarnBeep = HoTT_Waring(); |
||
209 | HoTT_DataPointer = (unsigned char *) &GPSPacket; |
||
210 | return(sizeof(GPSPacket)); |
||
211 | break; |
||
212 | case HOTT_ELECTRIC_AIR_PACKET_ID: |
||
213 | GetHottestBl(); |
||
214 | ElectricAirPacket.Altitude = HoehenWert/100 + 500; |
||
215 | ElectricAirPacket.Battery1 = UBat; |
||
216 | ElectricAirPacket.Battery2 = UBat; |
||
217 | ElectricAirPacket.VoltageCell1 = ErsatzKompassInGrad / 2; |
||
218 | ElectricAirPacket.VoltageCell8 = ElectricAirPacket.VoltageCell1; |
||
219 | ElectricAirPacket.VoltageCell6 = GPSInfo.HomeBearing / 2; |
||
220 | ElectricAirPacket.VoltageCell7 = GPSInfo.HomeDistance/20; |
||
221 | ElectricAirPacket.VoltageCell13 = ElectricAirPacket.VoltageCell6; |
||
222 | ElectricAirPacket.VoltageCell14 = ElectricAirPacket.VoltageCell7; |
||
223 | ElectricAirPacket.m_sec = BuildHoTT_Vario(); |
||
224 | ElectricAirPacket.m_3sec = 120; |
||
225 | ElectricAirPacket.InputVoltage = UBat; |
||
226 | ElectricAirPacket.Temperature1 = MinBlTempertaure + 20; |
||
227 | ElectricAirPacket.Temperature2 = MaxBlTempertaure + 20; |
||
228 | ElectricAirPacket.Capacity = Capacity.UsedCapacity/10; |
||
229 | ElectricAirPacket.WarnBeep = HoTT_Waring(); |
||
230 | ElectricAirPacket.Current = Capacity.ActualCurrent; |
||
231 | HoTT_DataPointer = (unsigned char *) &ElectricAirPacket; |
||
232 | return(sizeof(ElectricAirPacket)); |
||
233 | break; |
||
234 | case HOTT_GENERAL_PACKET_ID: |
||
235 | GetHottestBl(); |
||
236 | HoTTGeneral.Rpm = GPSInfo.HomeDistance/100; |
||
237 | HoTTGeneral.VoltageCell1 = ErsatzKompassInGrad / 2; |
||
238 | HoTTGeneral.VoltageCell6 = GPSInfo.HomeBearing / 2; |
||
239 | if(UBat > BattLowVoltageWarning + 5) HoTTGeneral.FuelPercent = (UBat - (BattLowVoltageWarning + 6)) * 3; |
||
240 | else HoTTGeneral.FuelPercent = 0; |
||
241 | HoTTGeneral.FuelCapacity = HoehenWert/100; |
||
242 | if(HoTTGeneral.FuelCapacity < 0) HoTTGeneral.FuelCapacity = 0; |
||
243 | HoTTGeneral.Altitude = HoehenWert/100 + 500; |
||
244 | HoTTGeneral.Battery1 = UBat; |
||
245 | HoTTGeneral.Battery2 = UBat; |
||
246 | HoTTGeneral.m_sec = BuildHoTT_Vario(); |
||
247 | HoTTGeneral.m_3sec = 120; |
||
248 | HoTTGeneral.InputVoltage = UBat; |
||
249 | HoTTGeneral.Temperature1 = MinBlTempertaure + 20; |
||
250 | HoTTGeneral.Temperature2 = MaxBlTempertaure + 20; |
||
251 | HoTTGeneral.Capacity = Capacity.UsedCapacity/10; |
||
252 | HoTTGeneral.WarnBeep = HoTT_Waring(); |
||
253 | HoTTGeneral.Current = Capacity.ActualCurrent; |
||
254 | HoTT_DataPointer = (unsigned char *) &HoTTGeneral; |
||
255 | return(sizeof(HoTTGeneral)); |
||
256 | break; |
||
257 | default: return(0); |
||
258 | } |
||
259 | } |
||
260 | |||
261 | //--------------------------------------------------------------- |
||
262 | void HoTT_Menu(void) |
||
263 | { |
||
264 | static unsigned char line, page = 0,show_current = 0,show_mag = 0, show_poti = 0; |
||
265 | unsigned char tmp; |
||
266 | HoTTVarioMeter = (HoTTVarioMeter * 7 + VarioMeter) / 8; |
||
267 | |||
268 | if(page == 0) |
||
269 | switch(line++) |
||
270 | { |
||
271 | case 0: |
||
272 | if(FC_StatusFlags & FC_STATUS_LOWBAT) |
||
273 | HoTT_printfxy_BLINK(0,0," %2i.%1iV ",UBat/10, UBat%10) |
||
274 | else |
||
275 | HoTT_printfxy(0,0," %2i.%1iV ",UBat/10, UBat%10) |
||
276 | |||
277 | if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG) |
||
278 | { |
||
279 | if(HoehenReglerAktiv) HoTT_printfxy_INV(10,0,"ALT:%4im %c", (int16_t)(HoehenWert/100),VarioCharacter) |
||
280 | else HoTT_printfxy(10,0,"ALT:%4im ", (int16_t)(HoehenWert/100)) |
||
281 | } |
||
282 | else HoTT_printfxy(10,0,"ALT:---- "); |
||
283 | break; |
||
284 | case 1: |
||
285 | if(FC_StatusFlags & FC_STATUS_LOWBAT) |
||
286 | HoTT_printfxy_BLINK(0,1," %2i:%02i ",FlugSekunden/60,FlugSekunden%60) |
||
287 | else HoTT_printfxy(0,1," %2i:%02i ",FlugSekunden/60,FlugSekunden%60); |
||
288 | HoTT_printfxy(10,1,"DIR: %3d%c",ErsatzKompassInGrad, HoTT_GRAD); |
||
289 | if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) HoTT_printfxy_INV(20,1,"C") else HoTT_printfxy(20,1," "); |
||
290 | break; |
||
291 | case 2: |
||
292 | if(FC_StatusFlags & FC_STATUS_LOWBAT) |
||
293 | HoTT_printfxy_BLINK(0,2," %5i ",Capacity.UsedCapacity) |
||
294 | else HoTT_printfxy(0,2," %5i ",Capacity.UsedCapacity); |
||
295 | HoTT_printfxy(12,2,"I:%2i.%1iA ",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10); |
||
296 | break; |
||
297 | case 3: |
||
298 | HoTT_printfxy(9,0,"I"); |
||
299 | HoTT_printfxy(9,1,"I"); |
||
300 | HoTT_printfxy(9,2,"I"); |
||
301 | HoTT_printfxy(0,3,"---------+-----------"); |
||
302 | HoTT_printfxy(0,6,"---------------------"); |
||
303 | break; |
||
304 | case 4: |
||
305 | if(NaviDataOkay) |
||
306 | { |
||
307 | HoTT_printfxy(9,4,"I"); |
||
308 | HoTT_printfxy(0,4,"SAT:%2d ",GPSInfo.NumOfSats); |
||
309 | HoTT_printfxy(10,4,"DIST:%3dm",GPSInfo.HomeDistance/10); |
||
310 | switch (GPSInfo.SatFix) |
||
311 | { |
||
312 | case SATFIX_3D: |
||
313 | if(GPSInfo.Flags & FLAG_DIFFSOLN) HoTT_printfxy(7,4,"D ") |
||
314 | else HoTT_printfxy(7,4,"3D"); |
||
315 | break; |
||
316 | default: |
||
317 | HoTT_printfxy_BLINK(7,4,"!!"); |
||
318 | break; |
||
319 | } |
||
320 | } |
||
321 | else |
||
322 | { |
||
323 | Hott_ClearLine(4); |
||
324 | } |
||
325 | break; |
||
326 | case 5: |
||
327 | if(NaviDataOkay) |
||
328 | { |
||
329 | if(show_mag) |
||
330 | { |
||
331 | HoTT_printfxy(0,5,"MAG:%3u%% ",EarthMagneticField); |
||
332 | HoTT_printfxy(12,5,"HM:%3d%c %c", GPSInfo.HomeBearing, HoTT_GRAD, NC_GPS_ModeCharacter); |
||
333 | HoTT_printfxy(9,5,"incl:%2d%c(%2i)",EarthMagneticInclination, HoTT_GRAD,EarthMagneticInclinationTheoretic); |
||
334 | } |
||
335 | else |
||
336 | { |
||
337 | HoTT_printfxy(9,5,"I"); |
||
338 | HoTT_printfxy(0,5," %2um/s",GPSInfo.Speed,GPSInfo.NumOfSats); |
||
339 | HoTT_printfxy(11,5," HM:%3d%c %c", GPSInfo.HomeBearing, HoTT_GRAD, NC_GPS_ModeCharacter); |
||
340 | } |
||
341 | } |
||
342 | else Hott_ClearLine(5); |
||
343 | break; |
||
344 | case 6: |
||
345 | break; |
||
346 | case 7: if(NC_ErrorCode) |
||
347 | { |
||
348 | if(HoTTBlink && NC_ErrorCode < MAX_ERR_NUMBER) |
||
349 | { |
||
350 | Hott_ClearLine(7); |
||
351 | HoTT_printfxy_INV(0,7,"ERR: %2d !",NC_ErrorCode); |
||
352 | } |
||
353 | else |
||
354 | { |
||
355 | HoTT_printfxy(0,7,"ERR: "); _printf_P(&LIBFC_HoTT_Putchar, NC_ERROR_TEXT[NC_ErrorCode] , 0);}; |
||
356 | } |
||
357 | else HoTT_printfxy(0,7," www.MikroKopter.de "); |
||
358 | break; |
||
359 | case 8: ASCIIPacket.WarnBeep = HoTT_Waring(); |
||
360 | // ASCIIPacket.WarnBeep = Parameter_UserParam1; |
||
361 | case 9: |
||
362 | case 10: |
||
363 | case 11: |
||
364 | case 12: |
||
365 | case 13: |
||
366 | case 14: |
||
367 | case 15: |
||
368 | case 16: |
||
369 | if(HottKeyboard == HOTT_KEY_SET) { if(show_mag) show_mag = 0; else show_mag = 1;} |
||
370 | else |
||
371 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page = 1; line = 0;}; |
||
372 | HottKeyboard = 0; |
||
373 | break; |
||
374 | default: line = 0; |
||
375 | break; |
||
376 | } |
||
377 | else |
||
378 | if(page == 1) |
||
379 | switch(line++) |
||
380 | { |
||
381 | case 0: |
||
382 | if(FC_StatusFlags & FC_STATUS_LOWBAT) |
||
383 | HoTT_printfxy_BLINK(0,0," %2i:%02i %2i.%1iV %4imAh",FlugSekunden/60,FlugSekunden%60,UBat/10, UBat%10,Capacity.UsedCapacity) |
||
384 | else HoTT_printfxy(0,0," %2i:%02i %2i.%1iV %4imAh",FlugSekunden/60,FlugSekunden%60,UBat/10, UBat%10,Capacity.UsedCapacity); |
||
385 | break; |
||
386 | case 1: |
||
387 | HoTT_printfxy(0,1,"DIR:%3d%c",KompassValue, HoTT_GRAD); |
||
388 | if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG) |
||
389 | { |
||
390 | if(HoehenReglerAktiv) HoTT_printfxy_INV(10,1,"ALT:%4im", (int16_t)(HoehenWert/100)) |
||
391 | else HoTT_printfxy(10,1,"ALT:%4im", (int16_t)(HoehenWert/100)) |
||
392 | } |
||
393 | else HoTT_printfxy(10,1,"ALT:---- "); |
||
394 | HoTT_printfxy(20,1,"%c",VarioCharacter); |
||
395 | break; |
||
396 | case 2: |
||
397 | if(NaviDataOkay) |
||
398 | { |
||
399 | HoTT_printfxy(1,2,"HM:%3d%c DIST:%3dm %c", GPSInfo.HomeBearing, HoTT_GRAD, GPSInfo.HomeDistance/10, NC_GPS_ModeCharacter); |
||
400 | } |
||
401 | else |
||
402 | { |
||
403 | Hott_ClearLine(2); |
||
404 | } |
||
405 | break; |
||
406 | case 3: |
||
407 | HoTT_printfxy(0,3,"PWR:%2i.%1iA (%iW) ",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10,Capacity.ActualPower); |
||
408 | if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) HoTT_printfxy_INV(19,3,"CF") else HoTT_printfxy(19,3," "); |
||
409 | break; |
||
410 | case 4: |
||
411 | if(NaviDataOkay) |
||
412 | { |
||
413 | HoTT_printfxy(0,4,"GPS:%2um/s SAT:%d ",GPSInfo.Speed,GPSInfo.NumOfSats); |
||
414 | switch (GPSInfo.SatFix) |
||
415 | { |
||
416 | case SATFIX_3D: |
||
417 | HoTT_printfxy(16,4," 3D "); |
||
418 | break; |
||
419 | //case SATFIX_2D: |
||
420 | //case SATFIX_NONE: |
||
421 | default: |
||
422 | HoTT_printfxy_BLINK(16,4,"NOFIX"); |
||
423 | break; |
||
424 | } |
||
425 | if(GPSInfo.Flags & FLAG_DIFFSOLN) |
||
426 | { |
||
427 | HoTT_printfxy(16,4,"DGPS "); |
||
428 | } |
||
429 | } |
||
430 | else |
||
431 | { //012345678901234567890 |
||
432 | HoTT_printfxy(0,4," No NaviCtrl "); |
||
433 | } |
||
434 | break; |
||
435 | case 5: |
||
436 | if(show_current) |
||
437 | { |
||
438 | HoTT_printfxy(0,5,"%2i.%i %2i.%i %2i.%i %2i.%iA", Motor[0].Current/10,Motor[0].Current%10,Motor[1].Current/10,Motor[1].Current%10,Motor[2].Current/10,Motor[2].Current%10,Motor[3].Current/10,Motor[3].Current%10); |
||
439 | } |
||
440 | else |
||
441 | { |
||
442 | HoTT_printfxy(0,5,"%3i %3i %3i %3i%cC", Motor[0].Temperature, Motor[1].Temperature, Motor[2].Temperature, Motor[3].Temperature,HoTT_GRAD); |
||
443 | } |
||
444 | break; |
||
445 | case 6: |
||
446 | if(show_current) |
||
447 | { |
||
448 | if(RequiredMotors == 4) Hott_ClearLine(6); |
||
449 | else |
||
450 | if(RequiredMotors == 6) HoTT_printfxy(0,6,"%2i.%i %2i.%iA", Motor[4].Current/10,Motor[4].Current%10,Motor[5].Current/10,Motor[5].Current%10) |
||
451 | else |
||
452 | if(RequiredMotors > 6) HoTT_printfxy(0,6,"%2i.%i %2i.%i %2i.%i %2i.%iA", Motor[4].Current/10,Motor[4].Current%10,Motor[5].Current/10,Motor[5].Current%10,Motor[6].Current/10,Motor[6].Current%10,Motor[7].Current/10,Motor[7].Current%10); |
||
453 | } |
||
454 | else |
||
455 | { |
||
456 | if(RequiredMotors == 4) Hott_ClearLine(6); |
||
457 | else |
||
458 | if(RequiredMotors == 6) HoTT_printfxy(0,6,"%3i %3i%cC ", Motor[4].Temperature, Motor[5].Temperature,HoTT_GRAD) |
||
459 | else |
||
460 | if(RequiredMotors > 6) HoTT_printfxy(0,6,"%3i %3i %3i %3i%cC", Motor[4].Temperature, Motor[5].Temperature, Motor[6].Temperature, Motor[7].Temperature,HoTT_GRAD); |
||
461 | } |
||
462 | break; |
||
463 | case 7: if(NC_ErrorCode) |
||
464 | { |
||
465 | if(HoTTBlink && NC_ErrorCode < MAX_ERR_NUMBER) |
||
466 | { |
||
467 | Hott_ClearLine(7); |
||
468 | HoTT_printfxy_INV(0,7,"ERR: %2d !",NC_ErrorCode); |
||
469 | } |
||
470 | else |
||
471 | { |
||
472 | HoTT_printfxy(0,7,"ERR: "); _printf_P(&LIBFC_HoTT_Putchar, NC_ERROR_TEXT[NC_ErrorCode] , 0);}; |
||
473 | } |
||
474 | else HoTT_printfxy(0,7," www.MikroKopter.de "); |
||
475 | break; |
||
476 | case 8: ASCIIPacket.WarnBeep = HoTT_Waring(); |
||
477 | // ASCIIPacket.WarnBeep = Parameter_UserParam1; |
||
478 | case 9: |
||
479 | case 10: |
||
480 | case 11: |
||
481 | case 12: |
||
482 | case 13: |
||
483 | case 14: |
||
484 | case 15: |
||
485 | case 16: |
||
486 | if(HottKeyboard == HOTT_KEY_SET) { if(show_current) show_current = 0; else show_current = 1; Hott_ClearLine(5); Hott_ClearLine(6);} |
||
487 | else |
||
488 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page = 2; line = 0;} |
||
489 | else |
||
490 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page = 0; line = 0;} |
||
491 | //if(HottKeyboard) HoTT_printfxy(15,6,"%KEY:%02x ",HottKeyboard); |
||
492 | HottKeyboard = 0; |
||
493 | break; |
||
494 | default: line = 0; |
||
495 | break; |
||
496 | } |
||
497 | else |
||
498 | if(page == 2) |
||
499 | switch(line++) |
||
500 | { |
||
501 | case 0: |
||
502 | HoTT_printfxy_INV(0,0,"Setting:%u %s ",GetActiveParamSet(),EE_Parameter.Name); |
||
503 | break; |
||
504 | case 1: HoTT_printfxy(0,1,"Min:%2i.%1iV %s ",BattLowVoltageWarning/10, BattLowVoltageWarning%10, Mixer.Name); |
||
505 | break; |
||
506 | case 2: HoTT_printfxy(0,2,"ALT:"); |
||
507 | if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG) |
||
508 | { |
||
509 | if(!(EE_Parameter.GlobalConfig & CFG_HOEHEN_SCHALTER)) HoTT_printf("POTI:%3u ", Parameter_HoehenSchalter) |
||
510 | else |
||
511 | { |
||
512 | if(Parameter_HoehenSchalter > 50) HoTT_printf("(ON) ") else HoTT_printf("(OFF) "); |
||
513 | if((Parameter_ExtraConfig & CFG2_HEIGHT_LIMIT)) HoTT_printf("LIMIT", Parameter_HoehenSchalter) |
||
514 | else HoTT_printf("VARIO", Parameter_HoehenSchalter); |
||
515 | } |
||
516 | } |
||
517 | else |
||
518 | HoTT_printf("DISABLED"); |
||
519 | break; |
||
520 | case 3: HoTT_printfxy(0,3,"CF:"); |
||
521 | if(!EE_Parameter.CareFreeModeControl) HoTT_printf("DISABLED") |
||
522 | else |
||
523 | { |
||
524 | if(CareFree) HoTT_printf(" (ON) ") else HoTT_printf(" (OFF)"); |
||
525 | if(EE_Parameter.ExtraConfig & CFG_LEARNABLE_CAREFREE) HoTT_printf(" TEACH"); |
||
526 | } |
||
527 | break; |
||
528 | case 4: HoTT_printfxy(0,4,"GPS:"); |
||
529 | if(!(Parameter_GlobalConfig & CFG_GPS_AKTIV)) HoTT_printf("DISABLED") |
||
530 | else |
||
531 | { |
||
532 | CHK_POTI(tmp,EE_Parameter.NaviGpsModeControl); |
||
533 | if(tmp < 50) HoTT_printf("(FREE)") |
||
534 | else |
||
535 | if(tmp >= 180) HoTT_printf("(HOME)") |
||
536 | else |
||
537 | if(EE_Parameter.ExtraConfig & CFG_GPS_AID) HoTT_printf("(AID) ") |
||
538 | else HoTT_printf("(HOLD)") |
||
539 | } |
||
540 | if(EE_Parameter.FailSafeTime) HoTT_printfxy(10,4," FS:%usek ",EE_Parameter.FailSafeTime) |
||
541 | |||
542 | break; |
||
543 | case 5: HoTT_printfxy(0,5,"HOME ALT:"); |
||
544 | if(EE_Parameter.ComingHomeAltitude) HoTT_printf("%um",EE_Parameter.ComingHomeAltitude) else HoTT_printf("HOLD "); |
||
545 | break; |
||
546 | case 6: |
||
547 | if(!show_poti) |
||
548 | { |
||
549 | HoTT_printfxy(0,6,"Ni:%4i Ro:%4i C:%3i",PPM_in[EE_Parameter.Kanalbelegung[K_NICK]],PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]], Parameter_ServoNickControl); |
||
550 | HoTT_printfxy(0,7,"Gs:%4i Ya:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_GAS]]+127,PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]); |
||
551 | } |
||
552 | else |
||
553 | { |
||
554 | HoTT_printfxy(0,6,"P1:%4i P2:%4i 3:%3i",Poti1,Poti2, Poti3); |
||
555 | HoTT_printfxy(0,7,"P4:%4i P5:%4i 6:%3i",Poti4,Poti5, Poti6); |
||
556 | } |
||
557 | |||
558 | break; |
||
559 | case 7: //HoTT_printfxy(0,6,"WARNINGS:"); |
||
560 | if(HoTTBlink) |
||
561 | { |
||
562 | LIBFC_HoTT_SetPos(6 * 21); |
||
563 | if(!(Parameter_GlobalConfig & CFG_ACHSENKOPPLUNG_AKTIV)) HoTT_printf_BLINK("COUPLING OFF! "); |
||
564 | if(EE_Parameter.BitConfig & (CFG_LOOP_LINKS | CFG_LOOP_RECHTS | CFG_LOOP_UNTEN | CFG_LOOP_OBEN)) HoTT_printf_BLINK("LOOPING! "); |
||
565 | if(Parameter_GlobalConfig & CFG_HEADING_HOLD) HoTT_printf_BLINK("HH! "); |
||
566 | if(!(Parameter_GlobalConfig & CFG_KOMPASS_AKTIV)) HoTT_printf_BLINK("COMPASS OFF! "); |
||
567 | } |
||
568 | break; |
||
569 | case 8: ASCIIPacket.WarnBeep = HoTT_Waring(); |
||
570 | break; |
||
571 | case 9: |
||
572 | case 10: |
||
573 | case 11: |
||
574 | case 12: |
||
575 | case 13: |
||
576 | case 14: |
||
577 | case 15: |
||
578 | case 16: |
||
579 | if(HottKeyboard == HOTT_KEY_SET) { if(show_poti) show_poti = 0; else show_poti = 1; Hott_ClearLine(6); Hott_ClearLine(7);} |
||
580 | else |
||
581 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page = 1; line = 0;}; |
||
582 | HottKeyboard = 0; |
||
583 | break; |
||
584 | default: line = 0; |
||
585 | break; |
||
586 | } |
||
587 | else page = 0; |
||
588 | } |
||
589 | |||
590 | #endif |
||
591 | |||
592 | |||
593 |