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