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