Rev 2692 | Rev 2701 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2050 | holgerb | 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 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
1917 | holgerb | 53 | #include "libfc.h" |
54 | #include "printf_P.h" |
||
55 | #include "main.h" |
||
56 | #include "spi.h" |
||
57 | #include "capacity.h" |
||
58 | |||
2426 | holgerb | 59 | unsigned char NaviData_WaypointIndex = 0; |
60 | unsigned char NaviData_WaypointNumber = 0, NaviData_TargetHoldTime = 0, ToNC_Load_WP_List = 0, NaviData_MaxWpListIndex = 0; |
||
2575 | holgerb | 61 | unsigned char ToNC_Load_SingePoint = 0, ToNC_Store_SingePoint = 0, Show_Load_Time = 0, Show_Load_Value = 0, Show_Store_Time = 0, Show_Store_Value = 0; |
2426 | holgerb | 62 | char WPL_Name[10];// = {" \0"}; |
2570 | holgerb | 63 | |
1925 | holgerb | 64 | #if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
65 | |||
1920 | holgerb | 66 | #define HoTT_printf(format, args...) { _printf_P(&LIBFC_HoTT_Putchar, PSTR(format) , ## args);} |
2527 | holgerb | 67 | #define HoTT_printfxy(x,y,format, args...) { LIBFC_HoTT_SetPos((y) * 21 + (x)); _printf_P(&LIBFC_HoTT_Putchar, PSTR(format) , ## args);} |
68 | #define HoTT_printfxy_INV(x,y,format, args...) { LIBFC_HoTT_SetPos((y) * 21 + (x)); _printf_P(&LIBFC_HoTT_Putchar_INV, PSTR(format) , ## args);} |
||
69 | #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 | 70 | #define HoTT_printf_BLINK(format, args...) { _printf_P(&LIBFC_HoTT_Putchar_BLINK, PSTR(format) , ## args);} |
71 | #define HoTT_printf_INV(format, args...) { _printf_P(&LIBFC_HoTT_Putchar_INV, PSTR(format) , ## args);} |
||
1917 | holgerb | 72 | |
1919 | holgerb | 73 | #define VOICE_MINIMALE_EINGANSSPANNUNG 16 |
74 | #define VOICE_BEEP 5 |
||
1920 | holgerb | 75 | #define HoTT_GRAD 96 |
76 | #define HoTT_LINKS 123 |
||
77 | #define HoTT_RECHTS 124 |
||
78 | #define HoTT_OBEN 125 |
||
79 | #define HoTT_UNTEN 126 |
||
1917 | holgerb | 80 | |
1949 | holgerb | 81 | #define HOTT_KEY_RIGHT 1 |
82 | #define HOTT_KEY_DOWN 2 |
||
83 | #define HOTT_KEY_UP 4 |
||
84 | #define HOTT_KEY_SET 6 |
||
85 | #define HOTT_KEY_LEFT 8 |
||
86 | |||
2322 | holgerb | 87 | #define VARIO_ZERO 30000 |
2178 | holgerb | 88 | unsigned int NaviData_TargetDistance = 0; |
89 | |||
2373 | holgerb | 90 | unsigned char MaxBlTemperture = 0; |
91 | unsigned char MinBlTemperture = 0; |
||
92 | unsigned char HottestBl = 0; |
||
93 | |||
1943 | holgerb | 94 | GPSPacket_t GPSPacket; |
95 | VarioPacket_t VarioPacket; |
||
96 | ASCIIPacket_t ASCIIPacket; |
||
97 | ElectricAirPacket_t ElectricAirPacket; |
||
98 | HoTTGeneral_t HoTTGeneral; |
||
2090 | holgerb | 99 | unsigned char SpeakHoTT = SPEAK_MIKROKOPTER; |
2608 | holgerb | 100 | unsigned char ToNC_SpeakHoTT = 0, ShowSettingNameTime = 0, ShowCmpsCalibrateTime = 0; |
1944 | holgerb | 101 | int HoTTVarioMeter = 0; |
2090 | holgerb | 102 | const char PROGMEM MIKROKOPTER[] = {" MikroKopter "}; |
2120 | holgerb | 103 | const char PROGMEM UNDERVOLTAGE[] = {" !! LiPo voltage !! "}; |
2390 | holgerb | 104 | const char PROGMEM LANDING[] = {" !! LANDING !! "}; |
2475 | holgerb | 105 | const char PROGMEM SIMULATION[] = {" SIMULATION active "}; |
2658 | holgerb | 106 | const char PROGMEM BOAT_MODE[] = {" Boat Mode "}; |
2570 | holgerb | 107 | const char PROGMEM STORE[] = {" Store Position SP1 "}; |
108 | const char PROGMEM LOAD[] = {" Load Position SP1 "}; |
||
2692 | holgerb | 109 | const char PROGMEM FLYZONE[] = {" Flyzone: points "}; |
2344 | holgerb | 110 | const char PROGMEM SETTING[] = {"Set :"}; |
2608 | holgerb | 111 | |
112 | const char PROGMEM CALIBRATE_TEXT[6][21] = |
||
113 | { |
||
114 | //0123456789123456 |
||
115 | "Finished \0", // 0 |
||
116 | "Compass Calibration \0", // 1 |
||
117 | "1:Rotate Nick & Roll\0", // 2 |
||
118 | "2: idle \0", // 3 |
||
119 | "3:Rotate Nick & Roll\0", // 4 |
||
120 | "4:Stored \0", // 5 |
||
121 | }; |
||
122 | |||
1930 | holgerb | 123 | const char PROGMEM NC_ERROR_TEXT[MAX_ERR_NUMBER][17] = |
124 | { |
||
125 | //0123456789123456 |
||
126 | "No Error \0", // 0 |
||
127 | "Not compatible \0", // 1 |
||
128 | "MK3Mag not compa\0", // 2 |
||
129 | "No FC communicat\0", // 3 |
||
2188 | holgerb | 130 | "Compass communic\0", // 4 |
1930 | holgerb | 131 | "GPS communicatio\0", // 5 |
132 | "compass value \0", // 6 |
||
133 | "RC Signal lost \0", // 7 |
||
134 | "FC spi rx error \0", // 8 |
||
135 | "No NC communicat\0", // 9 |
||
136 | "FC Nick Gyro \0", // 10 |
||
137 | "FC Roll Gyro \0", // 11 |
||
138 | "FC Yaw Gyro \0", // 12 |
||
139 | "FC Nick ACC \0", // 13 |
||
140 | "FC Roll ACC \0", // 14 |
||
141 | "FC Z-ACC \0", // 15 |
||
142 | "Pressure sensor \0", // 16 |
||
1936 | holgerb | 143 | "I2C FC->BL-Ctrl \0", // 17 |
1930 | holgerb | 144 | "Bl Missing \0", // 18 |
145 | "Mixer Error \0", // 19 |
||
1937 | holgerb | 146 | "Carefree Error \0", // 20 |
1944 | holgerb | 147 | "GPS Fix lost \0", // 21 |
1948 | holgerb | 148 | "Magnet Error \0", // 22 |
149 | "Motor restart \0", // 23 |
||
2008 | holgerb | 150 | "BL Limitation \0", // 24 |
151 | "GPS Range \0", // 25 |
||
2009 | holgerb | 152 | "No SD-Card \0", // 26 |
153 | "SD-Logging error\0", // 27 |
||
2034 | holgerb | 154 | "Flying range! \0", // 28 |
2146 | holgerb | 155 | "Max Altitude! \0", // 29 |
2186 | holgerb | 156 | "No GPS fix \0", // 30 |
2388 | holgerb | 157 | "compass not cal.\0", // 31 |
2408 | holgerb | 158 | "BL-Selftest \0", // 32 |
159 | "no ext. compass \0", // 33 |
||
2531 | holgerb | 160 | "compass sensor \0", // 34 |
161 | "Failsafe postion\0", // 35 |
||
162 | "No Redundancy! \0", // 36 |
||
2561 | holgerb | 163 | "Redundancy test \0", // 37 |
2608 | holgerb | 164 | "GPS Update Rate \0", // 38 |
165 | "Canbus Error \0", // 39 |
||
166 | "5V RC-Supply \0", // 40 |
||
167 | "Power-Supply \0", // 41 |
||
168 | "ACC not calibr. \0", // 42 |
||
2640 | holgerb | 169 | "Parachute! \0", // 43 |
2692 | holgerb | 170 | "Outside Flyzone \0", // 44 |
171 | "No Flyzone \0", // 45 |
||
2696 | holgerb | 172 | "ERR:Calibration \0", // 46 |
2561 | holgerb | 173 | }; |
2531 | holgerb | 174 | |
1919 | holgerb | 175 | |
2090 | holgerb | 176 | const char PROGMEM HOTT_ERROR[MAX_ERR_NUMBER][2] = |
177 | { // 1 -> only in flight 0 -> also on ground |
||
178 | //0123456789123456 |
||
179 | {0,0},// "No Error \0", // 0 |
||
2531 | holgerb | 180 | {SPEAK_ERROR,0}, // "Not compatible \0", // 1 |
181 | {SPEAK_ERROR,0}, // "MK3Mag not compa\0", // 2 |
||
182 | {SPEAK_ERR_NAVI,1}, // "No FC communicat\0", // 3 |
||
183 | {SPEAK_ERR_COMPASS,1}, // "MK3Mag communica\0", // 4 |
||
184 | {SPEAK_ERR_GPS,0}, // "GPS communicatio\0", // 5 |
||
185 | {SPEAK_ERR_COMPASS,1}, // "compass value \0", // 6 |
||
186 | {SPEAK_ERR_RECEICER,0},// "RC Signal lost \0", // 7 |
||
187 | {SPEAK_ERR_NAVI,0}, // "FC spi rx error \0", // 8 |
||
188 | {SPEAK_ERR_NAVI,0}, // "No NC communicat\0", // 9 |
||
189 | {SPEAK_ERR_SENSOR,0}, // "FC Nick Gyro \0", // 10 |
||
190 | {SPEAK_ERR_SENSOR,0}, // "FC Roll Gyro \0", // 11 |
||
191 | {SPEAK_ERR_SENSOR,0}, // "FC Yaw Gyro \0", // 12 |
||
192 | {SPEAK_ERR_SENSOR,0}, // "FC Nick ACC \0", // 13 |
||
193 | {SPEAK_ERR_SENSOR,0}, // "FC Roll ACC \0", // 14 |
||
194 | {SPEAK_ERR_SENSOR,0}, // "FC Z-ACC \0", // 15 |
||
195 | {SPEAK_ERR_SENSOR,0}, // "Pressure sensor \0", // 16 |
||
196 | {SPEAK_ERR_DATABUS,1}, // "I2C FC->BL-Ctrl \0", // 17 |
||
197 | {SPEAK_ERR_DATABUS,1}, // "Bl Missing \0", // 18 |
||
198 | {SPEAK_ERROR,0}, // "Mixer Error \0", // 19 |
||
199 | {SPEAK_CF_OFF,1}, // "Carefree Error \0", // 20 |
||
200 | {SPEAK_GPS_FIX,1}, // "GPS Fix lost \0", // 21 |
||
201 | {SPEAK_ERR_COMPASS,0}, // "Magnet Error \0", // 22 |
||
202 | {SPEAK_ERR_MOTOR,1}, // "Motor restart \0", // 23 |
||
203 | {SPEAK_MAX_TEMPERAT,1},// "BL Limitation \0", // 24 |
||
204 | {SPEAK_MAX_RANGE,1}, // "GPS Range \0", // 25 |
||
205 | {SPEAK_ERROR,1}, // "No SD-Card \0", // 26 |
||
206 | {SPEAK_ERROR,1}, // "SD-Logging error\0", // 27 |
||
207 | {SPEAK_MAX_RANGE,1}, // "Flying range! \0", // 28 |
||
208 | {SPEAK_MAX_ALTITUD,1}, // "Max Altitude! \0" // 29 |
||
209 | {SPEAK_GPS_FIX,1}, // "No GPS fix \0" // 30 |
||
210 | {SPEAK_ERR_CALIBARTION,0},// "compass not cal." // 31 |
||
211 | {SPEAK_ERR_MOTOR,0}, // "BL-Selftest \0" // 32 |
||
212 | {SPEAK_ERR_COMPASS,0}, // "no ext. compass" // 33 |
||
213 | {SPEAK_ERR_COMPASS,0}, // "compass sensor" // 34 |
||
214 | {SPEAK_ERROR,1}, // "Failsafe postion0", // 35 |
||
215 | {SPEAK_ERROR,0}, // "No Redundancy!", // 36 |
||
2561 | holgerb | 216 | {0,0}, // "Redundancy test", // 37 |
217 | {SPEAK_ERR_GPS,0}, // "GPS Update Rate", // 38 |
||
2608 | holgerb | 218 | {SPEAK_ERR_DATABUS,0}, // "Canbus Error! // 39 |
2630 | holgerb | 219 | {SPEAK_RECEIV_VOLT,0}, // "5V Supply" // 40 |
2608 | holgerb | 220 | {SPEAK_UNDERVOLTAGE,0},// "Power Supply" // 41 |
221 | {SPEAK_ERR_SENSOR,0}, // "ACC not calibr. ", // 42 |
||
2692 | holgerb | 222 | {SPEAK_MK_OFF,0}, // "Parachute", // 43 |
223 | {SPEAK_MAX_RANGE,0}, // "Outside Area", // 44 |
||
2696 | holgerb | 224 | {SPEAK_ERROR,0}, // "No Flyzone", // 45 |
225 | {0,0} // "Err:Calibration" // 46 (achtung: hier nicht "SPEAK_ERR_CALIBARTION" einsetzen) |
||
226 | |||
2090 | holgerb | 227 | }; |
228 | |||
2527 | holgerb | 229 | /* |
230 | //------------------------------------------------------------------------------------------ |
||
231 | // HoTT-Plus |
||
232 | //------------------------------------------------------------------------------------------ |
||
233 | char dummy=0; |
||
234 | const Parameter_List_t Parameter_List[] = |
||
235 | { //offset,min,max,name,variable |
||
236 | {127, 0, 247,"SP1", (unsigned char *) &PPM_in[13] }, |
||
237 | {127, 0, 247,"SP2", (unsigned char *) &PPM_in[14] }, |
||
238 | {127, 0, 247,"SP3", (unsigned char *) &PPM_in[15] }, |
||
239 | {127, 0, 247,"SP4", (unsigned char *) &PPM_in[16] }, |
||
240 | { 0, 0, 247,"HD ", (unsigned char *) &EE_Parameter.Luftdruck_D }, |
||
241 | { 0, 0, 247,"HP ", (unsigned char *) &EE_Parameter.Hoehe_P }, |
||
242 | { 0, 0, 247,"HA ", (unsigned char *) &EE_Parameter.Hoehe_ACC_Wirkung }, |
||
243 | { 0, 0, 247,"HM ", (unsigned char *) &EE_Parameter.Hoehe_MinGas }, |
||
244 | { 0, 0, 247,"HV ", (unsigned char *) &EE_Parameter.Hoehe_HoverBand }, |
||
245 | { 0, 0, 247,"HG ", (unsigned char *) &EE_Parameter.Hoehe_Verstaerkung }, |
||
246 | { 0, 0, 247,"NG ", (unsigned char *) &EE_Parameter.NotGas }, |
||
247 | { 0, 0, 247,"StP", (unsigned char *) &EE_Parameter.Stick_P }, |
||
248 | { 0, 0, 247,"StD", (unsigned char *) &EE_Parameter.Stick_D }, |
||
249 | { 0, 0, 247,"SGP", (unsigned char *) &EE_Parameter.StickGier_P }, |
||
250 | { 0, 0, 247,"DrC", (unsigned char *) &EE_Parameter.Driftkomp }, |
||
251 | { 0, 0, 247,"GYP", (unsigned char *) &EE_Parameter.Gyro_P }, |
||
252 | { 0, 0, 247,"GYD", (unsigned char *) &EE_Parameter.Gyro_D }, |
||
253 | { 0, 0, 247,"GYI", (unsigned char *) &EE_Parameter.Gyro_I }, |
||
254 | { 0, 0, 247,"MaI", (unsigned char *) &EE_Parameter.I_Faktor }, |
||
255 | { 0, 0, 247,"GGP", (unsigned char *) &EE_Parameter.Gyro_Gier_P }, |
||
256 | { 0, 0, 247,"GGI", (unsigned char *) &EE_Parameter.Gyro_Gier_I }, |
||
257 | { 0, 0, 15,"GSt", (unsigned char *) &EE_Parameter.Gyro_Stability }, |
||
258 | { 0, 0, 247,"DSt", (unsigned char *) &EE_Parameter.DynamicStability }, |
||
259 | { 0, 0, 247,"NGG", (unsigned char *) &EE_Parameter.NaviGpsGain }, |
||
260 | { 0, 0, 247,"NWC", (unsigned char *) &EE_Parameter.NaviWindCorrection }, |
||
261 | { 0, 0, 247,"NSC", (unsigned char *) &EE_Parameter.NaviAccCompensation }, |
||
262 | { 0, 0, 247,"NAL", (unsigned char *) &EE_Parameter.NaviAngleLimitation }, |
||
263 | { 0, 0, 247,"NP ", (unsigned char *) &EE_Parameter.NaviGpsP }, |
||
264 | { 0, 0, 247,"ND ", (unsigned char *) &EE_Parameter.NaviGpsI }, |
||
265 | { 0, 0, 247,"NI ", (unsigned char *) &EE_Parameter.NaviGpsD }, |
||
266 | { 0, 0, 247,"LGL", (unsigned char *) &EE_Parameter.LoopGasLimit }, |
||
267 | { 0, 0, 247,"LHy", (unsigned char *) &EE_Parameter.LoopHysterese }, |
||
268 | { 0, 0, 247,"LTh", (unsigned char *) &EE_Parameter.LoopThreshold }, |
||
269 | { 0, 0, 0," ", (unsigned char *) &dummy }, |
||
270 | { 0, 0, 247,"FGP", (unsigned char *) &EE_Parameter.AchsKopplung1}, |
||
271 | { 0, 0, 247,"FNR", (unsigned char *) &EE_Parameter.AchsKopplung2}, |
||
272 | { 0, 0, 247,"CYC", (unsigned char *) &EE_Parameter.CouplingYawCorrection}, |
||
273 | { 0, 0, 247,"MSH", (unsigned char *) &EE_Parameter.MotorSmooth}, |
||
274 | { 0, 0, 247,"NCT", (unsigned char *) &EE_Parameter.ServoNickControl }, |
||
275 | { 0, 0, 247,"NCP", (unsigned char *) &EE_Parameter.ServoNickComp }, |
||
276 | { 0, 0, 247,"RCT", (unsigned char *) &EE_Parameter.ServoRollControl }, |
||
277 | { 0, 0, 247,"RCP", (unsigned char *) &EE_Parameter.ServoRollComp } |
||
278 | }; |
||
279 | unsigned char settingdest = 0; |
||
280 | //------------------------------------------------------------------------------------------ |
||
281 | // HoTT-Plus |
||
282 | //------------------------------------------------------------------------------------------ |
||
283 | */ |
||
1943 | holgerb | 284 | void GetHottestBl(void) |
285 | { |
||
286 | static unsigned char search = 0,tmp_max,tmp_min,who; |
||
287 | if(Motor[search].Temperature > tmp_max) { tmp_max = Motor[search].Temperature; who = search;} |
||
288 | else |
||
289 | if(Motor[search].Temperature) if(Motor[search].Temperature < tmp_min) tmp_min = Motor[search].Temperature; |
||
2373 | holgerb | 290 | if(++search >= MAX_MOTORS) |
1943 | holgerb | 291 | { |
292 | search = 0; |
||
2373 | holgerb | 293 | if(tmp_min != 255) MinBlTemperture = tmp_min; else MinBlTemperture = 0; |
294 | MaxBlTemperture = tmp_max; |
||
1943 | holgerb | 295 | HottestBl = who; |
296 | tmp_min = 255; |
||
297 | tmp_max = 0; |
||
298 | who = 0; |
||
299 | } |
||
300 | } |
||
301 | |||
1919 | holgerb | 302 | //--------------------------------------------------------------- |
1917 | holgerb | 303 | void Hott_ClearLine(unsigned char line) |
304 | { |
||
305 | HoTT_printfxy(0,line," "); |
||
306 | } |
||
1919 | holgerb | 307 | //--------------------------------------------------------------- |
1917 | holgerb | 308 | |
2178 | holgerb | 309 | |
1919 | holgerb | 310 | unsigned char HoTT_Waring(void) |
311 | { |
||
2090 | holgerb | 312 | unsigned char status = 0; |
313 | static char old_status = 0; |
||
314 | static int repeat; |
||
2531 | holgerb | 315 | //if(Parameter_UserParam1) SpeakHoTT = Parameter_UserParam1; |
2190 | holgerb | 316 | ToNC_SpeakHoTT = SpeakHoTT; |
2390 | holgerb | 317 | if(FC_StatusFlags & FC_STATUS_LOWBAT) |
318 | { |
||
319 | if(LowVoltageLandingActive && (EE_Parameter.Receiver == RECEIVER_HOTT)) status = SPEAK_LANDING; |
||
320 | else status = VOICE_MINIMALE_EINGANSSPANNUNG; // Jeti hat kein wort: "LANDEN" |
||
2408 | holgerb | 321 | if(SpeakHoTT && old_status == VOICE_MINIMALE_EINGANSSPANNUNG) status = SpeakHoTT; // das soll auch noch durch kommen |
2390 | holgerb | 322 | } |
2090 | holgerb | 323 | else |
2408 | holgerb | 324 | if(NC_ErrorCode && NC_ErrorCode < MAX_ERR_NUMBER) // Fehlercodes |
2090 | holgerb | 325 | { |
326 | if(MotorenEin || !pgm_read_byte(&HOTT_ERROR[NC_ErrorCode][1])) status = pgm_read_byte(&HOTT_ERROR[NC_ErrorCode][0]); |
||
327 | } |
||
2263 | holgerb | 328 | if(!status) // Sprachansagen |
2091 | holgerb | 329 | { |
2263 | holgerb | 330 | // if(!(GetParamByte(PID_SPEAK_HOTT_CFG) & 0x01)) SpeakHoTT = 0; // is the voice wanted? |
331 | if(!(EE_Parameter.GlobalConfig3 & CFG3_SPEAK_ALL)) SpeakHoTT = 0; // is the voice wanted? |
||
2091 | holgerb | 332 | else status = SpeakHoTT; |
2190 | holgerb | 333 | } |
334 | else ToNC_SpeakHoTT = status; |
||
2090 | holgerb | 335 | |
2390 | holgerb | 336 | if(old_status == status) // Gleichen Fehler nur alle 4 sek bringen |
2090 | holgerb | 337 | { |
338 | if(!CheckDelay(repeat)) return(0); |
||
2390 | holgerb | 339 | repeat = SetDelay(4000); |
2090 | holgerb | 340 | } |
341 | else repeat = SetDelay(2000); |
||
342 | |||
343 | if(status) |
||
344 | { |
||
345 | if(status == SpeakHoTT) SpeakHoTT = 0; |
||
346 | } |
||
347 | old_status = status; |
||
348 | return(status); |
||
1919 | holgerb | 349 | } |
350 | |||
351 | //--------------------------------------------------------------- |
||
1942 | holgerb | 352 | void NC_Fills_HoTT_Telemety(void) |
1940 | holgerb | 353 | { |
2034 | holgerb | 354 | unsigned char *ptr = NULL; |
1940 | holgerb | 355 | unsigned char max = 0,i,z; |
356 | switch(FromNaviCtrl.Param.Byte[11]) |
||
357 | { |
||
358 | case HOTT_VARIO_PACKET_ID: |
||
359 | ptr = (unsigned char *) &VarioPacket; |
||
360 | max = sizeof(VarioPacket); |
||
361 | break; |
||
362 | case HOTT_GPS_PACKET_ID: |
||
363 | ptr = (unsigned char *) &GPSPacket; |
||
364 | max = sizeof(GPSPacket); |
||
365 | break; |
||
366 | case HOTT_ELECTRIC_AIR_PACKET_ID: |
||
367 | ptr = (unsigned char *) &ElectricAirPacket; |
||
368 | max = sizeof(ElectricAirPacket); |
||
369 | break; |
||
1943 | holgerb | 370 | case HOTT_GENERAL_PACKET_ID: |
371 | ptr = (unsigned char *) &HoTTGeneral; |
||
372 | max = sizeof(HoTTGeneral); |
||
373 | break; |
||
2377 | holgerb | 374 | case JETI_GPS_PACKET_ID1: |
375 | ptr = (unsigned char *) &JetiExData[14].Value; |
||
376 | max = sizeof(JetiExData[14].Value); |
||
377 | break; |
||
378 | case JETI_GPS_PACKET_ID2: |
||
379 | ptr = (unsigned char *) &JetiExData[15].Value; |
||
380 | max = sizeof(JetiExData[15].Value); |
||
381 | break; |
||
2424 | holgerb | 382 | case HOTT_WPL_NAME: |
383 | ptr = (unsigned char *) WPL_Name; |
||
384 | max = sizeof(WPL_Name)-1; |
||
385 | break; |
||
386 | |||
1940 | holgerb | 387 | } |
388 | z = FromNaviCtrl.Param.Byte[0]; // Data allocation |
||
389 | |||
390 | for(i=0; i < FromNaviCtrl.Param.Byte[1]; i++) |
||
391 | { |
||
392 | if(z >= max) break; |
||
393 | ptr[z] = FromNaviCtrl.Param.Byte[2+i]; |
||
394 | z++; |
||
395 | } |
||
396 | } |
||
397 | |||
1942 | holgerb | 398 | unsigned int BuildHoTT_Vario(void) |
399 | { |
||
2322 | holgerb | 400 | unsigned int tmp = VARIO_ZERO; |
1944 | holgerb | 401 | if(VarioCharacter == '+' || VarioCharacter == '-') |
402 | { |
||
2322 | holgerb | 403 | tmp = VARIO_ZERO + (AltitudeSetpointTrimming * EE_Parameter.Hoehe_Verstaerkung) / 3; |
404 | if(tmp < VARIO_ZERO && tmp > VARIO_ZERO - 50) tmp = VARIO_ZERO - 50; // weil es sonst erst bei < 0,5m/sek piept |
||
1944 | holgerb | 405 | } |
1942 | holgerb | 406 | else |
1944 | holgerb | 407 | if((VarioCharacter == ' ') && (FC_StatusFlags & FC_STATUS_FLY)) |
408 | { |
||
2322 | holgerb | 409 | tmp = VARIO_ZERO + HoTTVarioMeter; |
410 | if(tmp > VARIO_ZERO) |
||
1944 | holgerb | 411 | { |
2322 | holgerb | 412 | if(tmp < VARIO_ZERO + 100) tmp = VARIO_ZERO; |
1944 | holgerb | 413 | else tmp -= 100; |
414 | } |
||
2322 | holgerb | 415 | if(tmp < VARIO_ZERO) |
1944 | holgerb | 416 | { |
2322 | holgerb | 417 | if(tmp > VARIO_ZERO - 100) tmp = VARIO_ZERO; |
1944 | holgerb | 418 | else tmp += 100; |
419 | } |
||
420 | } |
||
421 | else |
||
2322 | holgerb | 422 | if(VarioCharacter == '^') tmp = VARIO_ZERO + FromNC_AltitudeSpeed * 10; |
1944 | holgerb | 423 | else |
2322 | holgerb | 424 | if(VarioCharacter == 'v') tmp = VARIO_ZERO - FromNC_AltitudeSpeed * 10; |
1942 | holgerb | 425 | return(tmp); |
426 | } |
||
427 | |||
1940 | holgerb | 428 | //--------------------------------------------------------------- |
1919 | holgerb | 429 | unsigned char HoTT_Telemety(unsigned char packet_request) |
430 | { |
||
2475 | holgerb | 431 | unsigned char i = 0; |
2531 | holgerb | 432 | static unsigned char SpeechMessage = 0; |
2090 | holgerb | 433 | //Debug("rqst: %02X",packet_request); |
1919 | holgerb | 434 | switch(packet_request) |
435 | { |
||
436 | case HOTT_VARIO_PACKET_ID: |
||
2531 | holgerb | 437 | if(GPSPacket.WarnBeep == SpeechMessage) SpeechMessage = HoTT_Waring(); // Achtung: das ist richtig hier, damit der Varioton schon vorher abgestellt wird |
438 | |||
1921 | holgerb | 439 | VarioPacket.Altitude = HoehenWert/100 + 500; |
2531 | holgerb | 440 | if(!SpeechMessage) VarioPacket.m_sec = BuildHoTT_Vario(); else VarioPacket.m_sec = VARIO_ZERO; |
1943 | holgerb | 441 | VarioPacket.m_3sec = VarioPacket.m_sec; |
442 | VarioPacket.m_10sec = VarioPacket.m_sec; |
||
1919 | holgerb | 443 | if (VarioPacket.Altitude < VarioPacket.MinAltitude) VarioPacket.MinAltitude = VarioPacket.Altitude; |
444 | if (VarioPacket.Altitude > VarioPacket.MaxAltitude) VarioPacket.MaxAltitude = VarioPacket.Altitude; |
||
2090 | holgerb | 445 | VarioPacket.WarnBeep = 0;//HoTT_Waring(); |
1919 | holgerb | 446 | HoTT_DataPointer = (unsigned char *) &VarioPacket; |
2090 | holgerb | 447 | VarioPacket.FreeCharacters[0] = VarioCharacter; |
448 | if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) VarioPacket.FreeCharacters[1] = 'C'; else VarioPacket.FreeCharacters[1] = ' '; |
||
449 | // VarioPacket.FreeCharacters[2] = ' '; |
||
450 | if(NC_ErrorCode) |
||
451 | { |
||
452 | VarioPacket.Text[0] = NC_ErrorCode/10 + '0'; |
||
453 | VarioPacket.Text[1] = NC_ErrorCode%10 + '0'; |
||
454 | VarioPacket.Text[2] = ':'; |
||
2183 | holgerb | 455 | for(i=0; i<16;i++) VarioPacket.Text[i+3] = pgm_read_byte(&NC_ERROR_TEXT[NC_ErrorCode][i]); |
2388 | holgerb | 456 | VarioPacket.Text[19] = ' '; |
457 | VarioPacket.Text[20] = ' '; |
||
2090 | holgerb | 458 | } |
2120 | holgerb | 459 | else |
2613 | holgerb | 460 | if(Partner_ErrorCode) |
461 | { |
||
462 | if(IamMaster == SLAVE) |
||
463 | { |
||
464 | VarioPacket.Text[0] = 'M'; |
||
465 | VarioPacket.Text[1] = 'A'; |
||
466 | } |
||
467 | else |
||
468 | { |
||
469 | VarioPacket.Text[0] = 'S'; |
||
470 | VarioPacket.Text[1] = 'L'; |
||
471 | } |
||
472 | VarioPacket.Text[2] = Partner_ErrorCode/10 + '0'; |
||
473 | VarioPacket.Text[3] = Partner_ErrorCode%10 + '0'; |
||
474 | VarioPacket.Text[4] = ':'; |
||
475 | for(i=0; i<16;i++) VarioPacket.Text[i+5] = pgm_read_byte(&NC_ERROR_TEXT[Partner_ErrorCode][i]); |
||
476 | } |
||
477 | else |
||
2608 | holgerb | 478 | if(ShowCmpsCalibrateTime) |
479 | { |
||
480 | for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&CALIBRATE_TEXT[WinkelOut.CalcState][i]); |
||
481 | } |
||
482 | else |
||
2390 | holgerb | 483 | if(LowVoltageLandingActive) for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&LANDING[i]); // no Error |
484 | else |
||
2120 | holgerb | 485 | if(FC_StatusFlags & FC_STATUS_LOWBAT) for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&UNDERVOLTAGE[i]); // no Error |
2348 | holgerb | 486 | else |
487 | if(ShowSettingNameTime) // no Error |
||
488 | { |
||
489 | for(i=0; i<sizeof(SETTING);i++) VarioPacket.Text[i] = pgm_read_byte(&SETTING[i]); |
||
490 | VarioPacket.Text[4] = '0' + ActiveParamSet; |
||
491 | for(i=0; i<sizeof(EE_Parameter.Name);i++) VarioPacket.Text[i+7] = EE_Parameter.Name[i]; // no Error |
||
2475 | holgerb | 492 | if(FC_StatusFlags3 & FC_STATUS3_BOAT) |
493 | { |
||
494 | VarioPacket.Text[17] = 'B'; |
||
495 | VarioPacket.Text[18] = 'O'; |
||
496 | VarioPacket.Text[19] = 'A'; |
||
497 | VarioPacket.Text[20] = 'T'; |
||
498 | } |
||
499 | else |
||
500 | { |
||
501 | VarioPacket.Text[18] = ' '; |
||
502 | VarioPacket.Text[19] = ' '; |
||
503 | VarioPacket.Text[20] = ' '; |
||
504 | } |
||
2348 | holgerb | 505 | } |
2570 | holgerb | 506 | else |
2575 | holgerb | 507 | if(Show_Store_Time) |
2570 | holgerb | 508 | { |
509 | for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&STORE[i]); // no Error and not calibrated |
||
2575 | holgerb | 510 | if(Show_Store_Value < 10) VarioPacket.Text[18] = Show_Store_Value + '0'; |
511 | else |
||
512 | { |
||
513 | VarioPacket.Text[18] = Show_Store_Value/10 + '0'; |
||
514 | VarioPacket.Text[19] = Show_Store_Value%10 + '0'; |
||
515 | } |
||
2570 | holgerb | 516 | } |
2120 | holgerb | 517 | else |
2575 | holgerb | 518 | if(Show_Load_Time) |
2570 | holgerb | 519 | { |
520 | for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&LOAD[i]); // no Error and not calibrated |
||
2575 | holgerb | 521 | if(Show_Load_Value < 10) VarioPacket.Text[17] = Show_Load_Value + '0'; |
522 | else |
||
523 | { |
||
524 | VarioPacket.Text[17] = Show_Load_Value/10 + '0'; |
||
525 | VarioPacket.Text[18] = Show_Load_Value%10 + '0'; |
||
526 | } |
||
2570 | holgerb | 527 | } |
528 | else |
||
2178 | holgerb | 529 | if(NaviData_WaypointNumber) |
530 | { |
||
531 | unsigned int tmp_int; |
||
532 | unsigned char tmp; |
||
533 | VarioPacket.Text[0] = 'W'; VarioPacket.Text[1] = 'P'; |
||
534 | VarioPacket.Text[2] = ' '; |
||
535 | VarioPacket.Text[3] = '0'+(NaviData_WaypointIndex) / 10; |
||
536 | VarioPacket.Text[4] = '0'+(NaviData_WaypointIndex) % 10; |
||
537 | VarioPacket.Text[5] = '/'; |
||
538 | VarioPacket.Text[6] = '0'+(NaviData_WaypointNumber) / 10; |
||
539 | VarioPacket.Text[7] = '0'+(NaviData_WaypointNumber) % 10; |
||
540 | VarioPacket.Text[8] = ' '; |
||
541 | tmp_int = NaviData_TargetDistance; |
||
542 | if(tmp_int > 1000) { VarioPacket.Text[9] = '0'+(tmp_int) / 1000; tmp_int %= 1000;} |
||
543 | else VarioPacket.Text[9] = ' '; |
||
544 | if(tmp_int > 100) { VarioPacket.Text[10] = '0'+(tmp_int) / 100; tmp_int %= 100;} |
||
545 | else VarioPacket.Text[10] = ' '; |
||
546 | VarioPacket.Text[11] = '0'+(tmp_int) / 10; |
||
547 | VarioPacket.Text[12] = '0'+(tmp_int) % 10; |
||
548 | VarioPacket.Text[13] = 'm'; |
||
549 | VarioPacket.Text[14] = ' '; |
||
550 | tmp = NaviData_TargetHoldTime; |
||
551 | if(tmp > 100) { VarioPacket.Text[15] = '0'+(tmp) / 100; tmp %= 100;} else VarioPacket.Text[15] = ' '; |
||
552 | VarioPacket.Text[16] = '0'+(tmp) / 10; |
||
553 | VarioPacket.Text[17] = '0'+(tmp) % 10; |
||
554 | VarioPacket.Text[18] = 's'; |
||
555 | VarioPacket.Text[19] = ' '; |
||
2407 | holgerb | 556 | VarioPacket.Text[20] = ' '; |
2692 | holgerb | 557 | if(FlyzonePointCnt >= 3) VarioPacket.Text[20] = 'F'; |
2178 | holgerb | 558 | } |
2692 | holgerb | 559 | else if(FlyzonePointCnt) |
560 | { |
||
561 | for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&FLYZONE[i]); |
||
562 | if(FlyzonePointCnt >=10) VarioPacket.Text[9] = '0'+(FlyzonePointCnt) / 10; |
||
563 | VarioPacket.Text[10] = '0'+(FlyzonePointCnt) % 10; |
||
564 | } |
||
2178 | holgerb | 565 | else |
2475 | holgerb | 566 | if(NC_To_FC_Flags & NC_TO_FC_SIMULATION_ACTIVE) |
567 | { |
||
568 | for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&SIMULATION[i]); |
||
569 | } |
||
570 | else |
||
2355 | holgerb | 571 | if(!CalibrationDone) |
2344 | holgerb | 572 | { |
2658 | holgerb | 573 | if(OEM_String[0] == 0xff) for(i=0; i<17;i++) VarioPacket.Text[i] = pgm_read_byte(&MIKROKOPTER[i+2]); // no Error and not calibrated |
574 | else for(i=0; i<16;i++) VarioPacket.Text[i] = OEM_String[i]; // no Error and not calibrated |
||
2355 | holgerb | 575 | VarioPacket.Text[16] = '0'+VERSION_MAJOR; |
576 | VarioPacket.Text[17] = '.'; |
||
577 | VarioPacket.Text[18] = '0'+VERSION_MINOR/10; |
||
578 | VarioPacket.Text[19] = '0'+VERSION_MINOR%10; |
||
579 | VarioPacket.Text[20] = 'a'+VERSION_PATCH; |
||
2344 | holgerb | 580 | } |
2355 | holgerb | 581 | else |
582 | { |
||
2475 | holgerb | 583 | if(FC_StatusFlags3 & FC_STATUS3_BOAT) for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&BOAT_MODE[i]); // no Error |
2658 | holgerb | 584 | else |
585 | { |
||
586 | if(OEM_String[0] == 0xff) |
||
587 | { |
||
588 | for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&MIKROKOPTER[i]); // no Error |
||
589 | } |
||
590 | else |
||
591 | { |
||
592 | VarioPacket.Text[0] = ' '; |
||
593 | VarioPacket.Text[1] = ' '; |
||
594 | VarioPacket.Text[2] = ' '; |
||
595 | for(i=0; i<16;i++) VarioPacket.Text[i+3] = OEM_String[i]; // no Error and not calibrated |
||
596 | VarioPacket.Text[20] = ' '; |
||
597 | } |
||
598 | } |
||
2531 | holgerb | 599 | if(FC_StatusFlags3 & FC_STATUS3_REDUNDANCE_AKTIVE) VarioPacket.Text[0] = 'R'; |
2355 | holgerb | 600 | } |
1919 | holgerb | 601 | return(sizeof(VarioPacket)); |
602 | break; |
||
1921 | holgerb | 603 | |
1919 | holgerb | 604 | case HOTT_GPS_PACKET_ID: |
2186 | holgerb | 605 | GPSPacket.Altitude = HoehenWert/100 + 500; |
1943 | holgerb | 606 | // GPSPacket.Distance = GPSInfo.HomeDistance/10; // macht die NC |
607 | // GPSPacket.Heading = GPSInfo.HomeBearing/2; // macht die NC |
||
608 | // GPSPacket.Speed = (GPSInfo.Speed * 36) / 10; // macht die NC |
||
2531 | holgerb | 609 | GPSPacket.WarnBeep = SpeechMessage; |
2322 | holgerb | 610 | if(!GPSPacket.WarnBeep) GPSPacket.m_sec = BuildHoTT_Vario(); else GPSPacket.m_sec = VARIO_ZERO; |
1921 | holgerb | 611 | GPSPacket.m_3sec = 120; |
2090 | holgerb | 612 | GPSPacket.NumOfSats = GPSInfo.NumOfSats; |
613 | if(GPSInfo.Flags & FLAG_DIFFSOLN) GPSPacket.SatFix = 'D'; |
||
614 | else |
||
615 | if(GPSInfo.SatFix == SATFIX_3D) GPSPacket.SatFix = ' '; |
||
616 | else GPSPacket.SatFix = '!'; |
||
1919 | holgerb | 617 | HoTT_DataPointer = (unsigned char *) &GPSPacket; |
2090 | holgerb | 618 | GPSPacket.FreeCharacters[0] = NC_GPS_ModeCharacter; |
2623 | holgerb | 619 | GPSPacket.FreeCharacters[1] = CamCtrlCharacter; |
2090 | holgerb | 620 | GPSPacket.FreeCharacters[2] = GPSPacket.SatFix; |
621 | GPSPacket.HomeDirection = GPSInfo.HomeBearing / 2;//230; |
||
1919 | holgerb | 622 | return(sizeof(GPSPacket)); |
623 | break; |
||
624 | case HOTT_ELECTRIC_AIR_PACKET_ID: |
||
1943 | holgerb | 625 | GetHottestBl(); |
1940 | holgerb | 626 | ElectricAirPacket.Altitude = HoehenWert/100 + 500; |
1921 | holgerb | 627 | ElectricAirPacket.Battery1 = UBat; |
1940 | holgerb | 628 | ElectricAirPacket.Battery2 = UBat; |
2437 | holgerb | 629 | ElectricAirPacket.VoltageCell1 = CompassCorrected / 2; |
1943 | holgerb | 630 | ElectricAirPacket.VoltageCell8 = ElectricAirPacket.VoltageCell1; |
1944 | holgerb | 631 | ElectricAirPacket.VoltageCell6 = GPSInfo.HomeBearing / 2; |
1943 | holgerb | 632 | ElectricAirPacket.VoltageCell7 = GPSInfo.HomeDistance/20; |
1944 | holgerb | 633 | ElectricAirPacket.VoltageCell13 = ElectricAirPacket.VoltageCell6; |
1943 | holgerb | 634 | ElectricAirPacket.VoltageCell14 = ElectricAirPacket.VoltageCell7; |
2531 | holgerb | 635 | if(!SpeechMessage) ElectricAirPacket.m_sec = BuildHoTT_Vario(); else ElectricAirPacket.m_sec = VARIO_ZERO; |
1940 | holgerb | 636 | ElectricAirPacket.m_3sec = 120; |
637 | ElectricAirPacket.InputVoltage = UBat; |
||
2373 | holgerb | 638 | ElectricAirPacket.Temperature1 = MinBlTemperture + 20; |
639 | ElectricAirPacket.Temperature2 = MaxBlTemperture + 20; |
||
1940 | holgerb | 640 | ElectricAirPacket.Capacity = Capacity.UsedCapacity/10; |
2531 | holgerb | 641 | ElectricAirPacket.WarnBeep = 0;//HoTT_Waring(); |
642 | //ElectricAirPacket.WarnBeep = SpeechMessage; |
||
1940 | holgerb | 643 | ElectricAirPacket.Current = Capacity.ActualCurrent; |
1919 | holgerb | 644 | HoTT_DataPointer = (unsigned char *) &ElectricAirPacket; |
2090 | holgerb | 645 | ElectricAirPacket.FlightTimeMinutes = FlugSekunden / 60; |
646 | ElectricAirPacket.FlightTimeSeconds = FlugSekunden % 60; |
||
1919 | holgerb | 647 | return(sizeof(ElectricAirPacket)); |
648 | break; |
||
1943 | holgerb | 649 | case HOTT_GENERAL_PACKET_ID: |
650 | GetHottestBl(); |
||
651 | HoTTGeneral.Rpm = GPSInfo.HomeDistance/100; |
||
2437 | holgerb | 652 | HoTTGeneral.VoltageCell1 = CompassCorrected / 2; |
2373 | holgerb | 653 | HoTTGeneral.VoltageCell2 = KompassValue / 2; |
654 | //HoTTGeneral.VoltageCell3 = Magnetstaerke -> macht NC |
||
655 | //HoTTGeneral.VoltageCell4 = Inclinition -> macht NC |
||
656 | HoTTGeneral.VoltageCell5 = DebugOut.Analog[28]; // I2C ErrorCounter |
||
1944 | holgerb | 657 | HoTTGeneral.VoltageCell6 = GPSInfo.HomeBearing / 2; |
2373 | holgerb | 658 | if(UBat > BattLowVoltageWarning + 2) HoTTGeneral.FuelPercent = (UBat - (BattLowVoltageWarning + 2)) * 3; |
1943 | holgerb | 659 | else HoTTGeneral.FuelPercent = 0; |
2373 | holgerb | 660 | if(HoTTGeneral.FuelPercent > 100) HoTTGeneral.FuelPercent = 100; |
661 | HoTTGeneral.FuelCapacity = NC_ErrorCode;//HoehenWert/100; // Oelpegel |
||
662 | // if(HoTTGeneral.FuelCapacity < 0) HoTTGeneral.FuelCapacity = 0; |
||
1943 | holgerb | 663 | HoTTGeneral.Altitude = HoehenWert/100 + 500; |
664 | HoTTGeneral.Battery1 = UBat; |
||
665 | HoTTGeneral.Battery2 = UBat; |
||
2531 | holgerb | 666 | if(!SpeechMessage) HoTTGeneral.m_sec = BuildHoTT_Vario(); else HoTTGeneral.m_sec = VARIO_ZERO; |
667 | HoTTGeneral.m_3sec = 120 + SpeechMessage; |
||
1943 | holgerb | 668 | HoTTGeneral.InputVoltage = UBat; |
2373 | holgerb | 669 | HoTTGeneral.Temperature1 = MinBlTemperture + 20; |
670 | HoTTGeneral.Temperature2 = MaxBlTemperture + 20; |
||
1943 | holgerb | 671 | HoTTGeneral.Capacity = Capacity.UsedCapacity/10; |
2531 | holgerb | 672 | HoTTGeneral.WarnBeep = 0; |
1943 | holgerb | 673 | HoTTGeneral.Current = Capacity.ActualCurrent; |
2178 | holgerb | 674 | //HoTTGeneral.ErrorNumber = HoTTErrorCode(); |
1943 | holgerb | 675 | HoTT_DataPointer = (unsigned char *) &HoTTGeneral; |
676 | return(sizeof(HoTTGeneral)); |
||
677 | break; |
||
1919 | holgerb | 678 | default: return(0); |
679 | } |
||
680 | } |
||
681 | |||
682 | //--------------------------------------------------------------- |
||
1917 | holgerb | 683 | void HoTT_Menu(void) |
684 | { |
||
2554 | holgerb | 685 | static unsigned char line, page = 0,show_current = 0,show_mag = 0, show_poti = 0,hyterese = 1; |
1944 | holgerb | 686 | HoTTVarioMeter = (HoTTVarioMeter * 7 + VarioMeter) / 8; |
2561 | holgerb | 687 | static int delay; |
2420 | holgerb | 688 | |
689 | // if(HottKeyboard) {beeptime = 1000;}; |
||
690 | switch(page) |
||
691 | { |
||
692 | case 0: |
||
1933 | holgerb | 693 | switch(line++) |
1917 | holgerb | 694 | { |
1919 | holgerb | 695 | case 0: |
1923 | holgerb | 696 | if(FC_StatusFlags & FC_STATUS_LOWBAT) |
1939 | holgerb | 697 | HoTT_printfxy_BLINK(0,0," %2i.%1iV ",UBat/10, UBat%10) |
698 | else |
||
699 | HoTT_printfxy(0,0," %2i.%1iV ",UBat/10, UBat%10) |
||
700 | |||
701 | if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG) |
||
702 | { |
||
703 | if(HoehenReglerAktiv) HoTT_printfxy_INV(10,0,"ALT:%4im %c", (int16_t)(HoehenWert/100),VarioCharacter) |
||
704 | else HoTT_printfxy(10,0,"ALT:%4im ", (int16_t)(HoehenWert/100)) |
||
705 | } |
||
706 | else HoTT_printfxy(10,0,"ALT:---- "); |
||
707 | break; |
||
708 | case 1: |
||
709 | if(FC_StatusFlags & FC_STATUS_LOWBAT) |
||
710 | HoTT_printfxy_BLINK(0,1," %2i:%02i ",FlugSekunden/60,FlugSekunden%60) |
||
711 | else HoTT_printfxy(0,1," %2i:%02i ",FlugSekunden/60,FlugSekunden%60); |
||
2437 | holgerb | 712 | HoTT_printfxy(10,1,"DIR: %3d%c",CompassCorrected, HoTT_GRAD); |
1949 | holgerb | 713 | if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) HoTT_printfxy_INV(20,1,"C") else HoTT_printfxy(20,1," "); |
1939 | holgerb | 714 | break; |
715 | case 2: |
||
716 | if(FC_StatusFlags & FC_STATUS_LOWBAT) |
||
717 | HoTT_printfxy_BLINK(0,2," %5i ",Capacity.UsedCapacity) |
||
718 | else HoTT_printfxy(0,2," %5i ",Capacity.UsedCapacity); |
||
1940 | holgerb | 719 | HoTT_printfxy(12,2,"I:%2i.%1iA ",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10); |
1939 | holgerb | 720 | break; |
721 | case 3: |
||
2072 | holgerb | 722 | HoTT_printfxy(9,0,":"); |
723 | HoTT_printfxy(9,1,":"); |
||
724 | HoTT_printfxy(9,2,":"); |
||
2681 | holgerb | 725 | if(FromNC_Laser_cm) HoTT_printfxy(0,3,"---------:LSR:%2d.%02dm ",FromNC_Laser_cm/100,FromNC_Laser_cm%100) |
726 | else HoTT_printfxy(0,3,"---------+-----------"); |
||
2072 | holgerb | 727 | |
1939 | holgerb | 728 | HoTT_printfxy(0,6,"---------------------"); |
729 | break; |
||
730 | case 4: |
||
731 | if(NaviDataOkay) |
||
732 | { |
||
2072 | holgerb | 733 | HoTT_printfxy(9,4,":"); |
1939 | holgerb | 734 | HoTT_printfxy(0,4,"SAT:%2d ",GPSInfo.NumOfSats); |
2670 | holgerb | 735 | HoTT_printfxy(10,4,"DIST:%3dm %c",GPSInfo.HomeDistance/10,NC_GPS_ModeCharacter); |
1939 | holgerb | 736 | switch (GPSInfo.SatFix) |
737 | { |
||
738 | case SATFIX_3D: |
||
739 | if(GPSInfo.Flags & FLAG_DIFFSOLN) HoTT_printfxy(7,4,"D ") |
||
740 | else HoTT_printfxy(7,4,"3D"); |
||
741 | break; |
||
742 | default: |
||
1943 | holgerb | 743 | HoTT_printfxy_BLINK(7,4,"!!"); |
1939 | holgerb | 744 | break; |
745 | } |
||
746 | } |
||
747 | else |
||
1944 | holgerb | 748 | { |
1940 | holgerb | 749 | Hott_ClearLine(4); |
1939 | holgerb | 750 | } |
751 | break; |
||
752 | case 5: |
||
753 | if(NaviDataOkay) |
||
754 | { |
||
1972 | holgerb | 755 | if(show_mag) |
756 | { |
||
757 | HoTT_printfxy(0,5,"MAG:%3u%% ",EarthMagneticField); |
||
758 | HoTT_printfxy(9,5,"incl:%2d%c(%2i)",EarthMagneticInclination, HoTT_GRAD,EarthMagneticInclinationTheoretic); |
||
759 | } |
||
760 | else |
||
761 | { |
||
2670 | holgerb | 762 | HoTT_printfxy(0,5," %2um/s: HM:%3d%c %c",GPSInfo.Speed, GPSInfo.HomeBearing, HoTT_GRAD, CamCtrlCharacter); |
1972 | holgerb | 763 | } |
1939 | holgerb | 764 | } |
1940 | holgerb | 765 | else Hott_ClearLine(5); |
1939 | holgerb | 766 | break; |
767 | case 6: |
||
768 | break; |
||
769 | case 7: if(NC_ErrorCode) |
||
770 | { |
||
771 | if(HoTTBlink && NC_ErrorCode < MAX_ERR_NUMBER) |
||
772 | { |
||
773 | Hott_ClearLine(7); |
||
774 | HoTT_printfxy_INV(0,7,"ERR: %2d !",NC_ErrorCode); |
||
775 | } |
||
776 | else |
||
777 | { |
||
778 | HoTT_printfxy(0,7,"ERR: "); _printf_P(&LIBFC_HoTT_Putchar, NC_ERROR_TEXT[NC_ErrorCode] , 0);}; |
||
779 | } |
||
2120 | holgerb | 780 | else |
781 | if(FC_StatusFlags & FC_STATUS_LOWBAT) HoTT_printfxy(1,7,"!! LiPo voltage !!") |
||
2658 | holgerb | 782 | else |
783 | { |
||
784 | if(OEM_String[0] == 0xff) HoTT_printfxy(0,7," www.MikroKopter.de ") |
||
2681 | holgerb | 785 | else |
786 | { |
||
787 | Hott_ClearLine(7); |
||
788 | HoTT_printfxy(2,7,"%s",OEM_String); // no Error and not calibrated |
||
789 | } |
||
2658 | holgerb | 790 | } |
1939 | holgerb | 791 | break; |
2090 | holgerb | 792 | case 8: //ASCIIPacket.WarnBeep = HoTT_Waring(); |
1939 | holgerb | 793 | // ASCIIPacket.WarnBeep = Parameter_UserParam1; |
794 | case 9: |
||
795 | case 10: |
||
796 | case 11: |
||
797 | case 12: |
||
798 | case 13: |
||
799 | case 14: |
||
800 | case 15: |
||
801 | case 16: |
||
2440 | holgerb | 802 | if(HottKeyboard == HOTT_KEY_DOWN) { LIBFC_HoTT_Clear(); page = 5; line = 0;} |
803 | else |
||
1972 | holgerb | 804 | if(HottKeyboard == HOTT_KEY_SET) { if(show_mag) show_mag = 0; else show_mag = 1;} |
805 | else |
||
1949 | holgerb | 806 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page = 1; line = 0;}; |
1939 | holgerb | 807 | HottKeyboard = 0; |
808 | break; |
||
809 | default: line = 0; |
||
810 | break; |
||
811 | } |
||
2420 | holgerb | 812 | break; |
813 | case 1: |
||
1939 | holgerb | 814 | switch(line++) |
815 | { |
||
816 | case 0: |
||
817 | if(FC_StatusFlags & FC_STATUS_LOWBAT) |
||
1923 | holgerb | 818 | HoTT_printfxy_BLINK(0,0," %2i:%02i %2i.%1iV %4imAh",FlugSekunden/60,FlugSekunden%60,UBat/10, UBat%10,Capacity.UsedCapacity) |
819 | else HoTT_printfxy(0,0," %2i:%02i %2i.%1iV %4imAh",FlugSekunden/60,FlugSekunden%60,UBat/10, UBat%10,Capacity.UsedCapacity); |
||
1917 | holgerb | 820 | break; |
821 | case 1: |
||
2437 | holgerb | 822 | HoTT_printfxy(0,1,"DIR:%3d%c",CompassCorrected, HoTT_GRAD); |
1917 | holgerb | 823 | if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG) |
1920 | holgerb | 824 | { |
825 | if(HoehenReglerAktiv) HoTT_printfxy_INV(10,1,"ALT:%4im", (int16_t)(HoehenWert/100)) |
||
826 | else HoTT_printfxy(10,1,"ALT:%4im", (int16_t)(HoehenWert/100)) |
||
827 | } |
||
828 | else HoTT_printfxy(10,1,"ALT:---- "); |
||
829 | HoTT_printfxy(20,1,"%c",VarioCharacter); |
||
1917 | holgerb | 830 | break; |
831 | case 2: |
||
832 | if(NaviDataOkay) |
||
833 | { |
||
1923 | holgerb | 834 | HoTT_printfxy(1,2,"HM:%3d%c DIST:%3dm %c", GPSInfo.HomeBearing, HoTT_GRAD, GPSInfo.HomeDistance/10, NC_GPS_ModeCharacter); |
1917 | holgerb | 835 | } |
836 | else |
||
837 | { |
||
1923 | holgerb | 838 | Hott_ClearLine(2); |
1917 | holgerb | 839 | } |
840 | break; |
||
1923 | holgerb | 841 | case 3: |
842 | HoTT_printfxy(0,3,"PWR:%2i.%1iA (%iW) ",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10,Capacity.ActualPower); |
||
1949 | holgerb | 843 | if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) HoTT_printfxy_INV(19,3,"CF") else HoTT_printfxy(19,3," "); |
1923 | holgerb | 844 | break; |
1917 | holgerb | 845 | case 4: |
846 | if(NaviDataOkay) |
||
847 | { |
||
1919 | holgerb | 848 | HoTT_printfxy(0,4,"GPS:%2um/s SAT:%d ",GPSInfo.Speed,GPSInfo.NumOfSats); |
1917 | holgerb | 849 | switch (GPSInfo.SatFix) |
850 | { |
||
851 | case SATFIX_3D: |
||
852 | HoTT_printfxy(16,4," 3D "); |
||
853 | break; |
||
1925 | holgerb | 854 | //case SATFIX_2D: |
855 | //case SATFIX_NONE: |
||
1917 | holgerb | 856 | default: |
1925 | holgerb | 857 | HoTT_printfxy_BLINK(16,4,"NOFIX"); |
1917 | holgerb | 858 | break; |
859 | } |
||
860 | if(GPSInfo.Flags & FLAG_DIFFSOLN) |
||
861 | { |
||
862 | HoTT_printfxy(16,4,"DGPS "); |
||
863 | } |
||
864 | } |
||
865 | else |
||
866 | { //012345678901234567890 |
||
1930 | holgerb | 867 | HoTT_printfxy(0,4," No NaviCtrl "); |
1917 | holgerb | 868 | } |
869 | break; |
||
870 | case 5: |
||
1949 | holgerb | 871 | if(show_current) |
872 | { |
||
2386 | holgerb | 873 | // 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); |
874 | HoTT_printfxy(0,5,"%2i.%i %2i.%i %2i.%i %2i.%iA", BL3_Current(0)/10,BL3_Current(0)%10,BL3_Current(1)/10,BL3_Current(1)%10,BL3_Current(2)/10,BL3_Current(2)%10,BL3_Current(3)/10,BL3_Current(3)%10); |
||
1949 | holgerb | 875 | } |
876 | else |
||
877 | { |
||
878 | HoTT_printfxy(0,5,"%3i %3i %3i %3i%cC", Motor[0].Temperature, Motor[1].Temperature, Motor[2].Temperature, Motor[3].Temperature,HoTT_GRAD); |
||
879 | } |
||
1917 | holgerb | 880 | break; |
881 | case 6: |
||
1949 | holgerb | 882 | if(show_current) |
883 | { |
||
1917 | holgerb | 884 | if(RequiredMotors == 4) Hott_ClearLine(6); |
885 | else |
||
2386 | holgerb | 886 | // 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) |
887 | if(RequiredMotors == 6) HoTT_printfxy(0,6,"%2i.%i %2i.%iA", BL3_Current(4)/10,BL3_Current(4)%10, BL3_Current(5)/10,BL3_Current(5)%10) |
||
1949 | holgerb | 888 | else |
2386 | holgerb | 889 | // 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); |
890 | if(RequiredMotors > 6) HoTT_printfxy(0,6,"%2i.%i %2i.%i %2i.%i %2i.%iA", BL3_Current(4)/10,BL3_Current(4)%10,BL3_Current(5)/10,BL3_Current(5)%10,BL3_Current(6)/10,BL3_Current(6)%10,BL3_Current(7)/10,BL3_Current(7)%10,BL3_Current(8)/10,BL3_Current(8)%10); |
||
1949 | holgerb | 891 | } |
892 | else |
||
893 | { |
||
894 | if(RequiredMotors == 4) Hott_ClearLine(6); |
||
895 | else |
||
1923 | holgerb | 896 | if(RequiredMotors == 6) HoTT_printfxy(0,6,"%3i %3i%cC ", Motor[4].Temperature, Motor[5].Temperature,HoTT_GRAD) |
1917 | holgerb | 897 | else |
1923 | holgerb | 898 | 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); |
1949 | holgerb | 899 | } |
1917 | holgerb | 900 | break; |
1930 | holgerb | 901 | case 7: if(NC_ErrorCode) |
902 | { |
||
903 | if(HoTTBlink && NC_ErrorCode < MAX_ERR_NUMBER) |
||
904 | { |
||
905 | Hott_ClearLine(7); |
||
906 | HoTT_printfxy_INV(0,7,"ERR: %2d !",NC_ErrorCode); |
||
907 | } |
||
908 | else |
||
909 | { |
||
910 | HoTT_printfxy(0,7,"ERR: "); _printf_P(&LIBFC_HoTT_Putchar, NC_ERROR_TEXT[NC_ErrorCode] , 0);}; |
||
911 | } |
||
2120 | holgerb | 912 | else |
913 | if(FC_StatusFlags & FC_STATUS_LOWBAT) HoTT_printfxy(1,7,"!! LiPo voltage !!") |
||
2658 | holgerb | 914 | else |
915 | if(OEM_String[0] == 0xff) HoTT_printfxy(0,7," www.MikroKopter.de ") |
||
916 | else HoTT_printfxy(0,7," %s ",OEM_String); // no Error and not calibrated |
||
1917 | holgerb | 917 | break; |
2090 | holgerb | 918 | case 8: // ASCIIPacket.WarnBeep = HoTT_Waring(); |
1919 | holgerb | 919 | // ASCIIPacket.WarnBeep = Parameter_UserParam1; |
1921 | holgerb | 920 | case 9: |
1917 | holgerb | 921 | case 10: |
922 | case 11: |
||
923 | case 12: |
||
924 | case 13: |
||
1919 | holgerb | 925 | case 14: |
926 | case 15: |
||
927 | case 16: |
||
1949 | holgerb | 928 | if(HottKeyboard == HOTT_KEY_SET) { if(show_current) show_current = 0; else show_current = 1; Hott_ClearLine(5); Hott_ClearLine(6);} |
929 | else |
||
2527 | holgerb | 930 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;} |
1949 | holgerb | 931 | else |
2527 | holgerb | 932 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;} |
1949 | holgerb | 933 | //if(HottKeyboard) HoTT_printfxy(15,6,"%KEY:%02x ",HottKeyboard); |
1921 | holgerb | 934 | HottKeyboard = 0; |
935 | break; |
||
1933 | holgerb | 936 | default: line = 0; |
1921 | holgerb | 937 | break; |
938 | } |
||
2420 | holgerb | 939 | break; |
940 | case 2: |
||
1933 | holgerb | 941 | switch(line++) |
1921 | holgerb | 942 | { |
943 | case 0: |
||
2344 | holgerb | 944 | HoTT_printfxy_INV(0,0,"Setting:%u %s ",ActiveParamSet,EE_Parameter.Name); |
1921 | holgerb | 945 | break; |
946 | case 1: HoTT_printfxy(0,1,"Min:%2i.%1iV %s ",BattLowVoltageWarning/10, BattLowVoltageWarning%10, Mixer.Name); |
||
947 | break; |
||
1923 | holgerb | 948 | case 2: HoTT_printfxy(0,2,"ALT:"); |
1921 | holgerb | 949 | if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG) |
950 | { |
||
951 | if(!(EE_Parameter.GlobalConfig & CFG_HOEHEN_SCHALTER)) HoTT_printf("POTI:%3u ", Parameter_HoehenSchalter) |
||
952 | else |
||
953 | { |
||
954 | if(Parameter_HoehenSchalter > 50) HoTT_printf("(ON) ") else HoTT_printf("(OFF) "); |
||
955 | if((Parameter_ExtraConfig & CFG2_HEIGHT_LIMIT)) HoTT_printf("LIMIT", Parameter_HoehenSchalter) |
||
956 | else HoTT_printf("VARIO", Parameter_HoehenSchalter); |
||
957 | } |
||
958 | } |
||
959 | else |
||
960 | HoTT_printf("DISABLED"); |
||
961 | break; |
||
1923 | holgerb | 962 | case 3: HoTT_printfxy(0,3,"CF:"); |
2342 | holgerb | 963 | if(!EE_Parameter.CareFreeChannel) HoTT_printf("DISABLED") |
1921 | holgerb | 964 | else |
965 | { |
||
966 | if(CareFree) HoTT_printf(" (ON) ") else HoTT_printf(" (OFF)"); |
||
967 | if(EE_Parameter.ExtraConfig & CFG_LEARNABLE_CAREFREE) HoTT_printf(" TEACH"); |
||
968 | } |
||
969 | break; |
||
1923 | holgerb | 970 | case 4: HoTT_printfxy(0,4,"GPS:"); |
971 | if(!(Parameter_GlobalConfig & CFG_GPS_AKTIV)) HoTT_printf("DISABLED") |
||
972 | else |
||
973 | { |
||
2599 | holgerb | 974 | if(Parameter_GPS_Switch < 50) HoTT_printf("(FREE)") |
1923 | holgerb | 975 | else |
2599 | holgerb | 976 | if(Parameter_GPS_Switch >= 180) HoTT_printf("(HOME)") |
1923 | holgerb | 977 | else |
978 | if(EE_Parameter.ExtraConfig & CFG_GPS_AID) HoTT_printf("(AID) ") |
||
979 | else HoTT_printf("(HOLD)") |
||
980 | } |
||
981 | if(EE_Parameter.FailSafeTime) HoTT_printfxy(10,4," FS:%usek ",EE_Parameter.FailSafeTime) |
||
982 | |||
983 | break; |
||
984 | case 5: HoTT_printfxy(0,5,"HOME ALT:"); |
||
985 | if(EE_Parameter.ComingHomeAltitude) HoTT_printf("%um",EE_Parameter.ComingHomeAltitude) else HoTT_printf("HOLD "); |
||
986 | break; |
||
1921 | holgerb | 987 | case 6: |
1982 | holgerb | 988 | if(!show_poti) |
989 | { |
||
2496 | holgerb | 990 | HoTT_printfxy(0,6,"Ni:%4i Ro:%4i C:%3i",ChannelNick,ChannelRoll, Parameter_ServoNickControl); |
991 | HoTT_printfxy(0,7,"Gs:%4i Ya:%4i ",ChannelGas+127,ChannelYaw); |
||
1982 | holgerb | 992 | } |
993 | else |
||
994 | { |
||
995 | HoTT_printfxy(0,6,"P1:%4i P2:%4i 3:%3i",Poti1,Poti2, Poti3); |
||
996 | HoTT_printfxy(0,7,"P4:%4i P5:%4i 6:%3i",Poti4,Poti5, Poti6); |
||
997 | } |
||
998 | |||
1921 | holgerb | 999 | break; |
1000 | case 7: //HoTT_printfxy(0,6,"WARNINGS:"); |
||
1001 | if(HoTTBlink) |
||
1002 | { |
||
1003 | LIBFC_HoTT_SetPos(6 * 21); |
||
1004 | if(EE_Parameter.BitConfig & (CFG_LOOP_LINKS | CFG_LOOP_RECHTS | CFG_LOOP_UNTEN | CFG_LOOP_OBEN)) HoTT_printf_BLINK("LOOPING! "); |
||
1005 | if(Parameter_GlobalConfig & CFG_HEADING_HOLD) HoTT_printf_BLINK("HH! "); |
||
1006 | if(!(Parameter_GlobalConfig & CFG_KOMPASS_AKTIV)) HoTT_printf_BLINK("COMPASS OFF! "); |
||
1007 | } |
||
1008 | break; |
||
2090 | holgerb | 1009 | case 8: //ASCIIPacket.WarnBeep = HoTT_Waring(); |
1921 | holgerb | 1010 | break; |
1011 | case 9: |
||
1012 | case 10: |
||
1013 | case 11: |
||
1014 | case 12: |
||
1015 | case 13: |
||
1016 | case 14: |
||
1017 | case 15: |
||
1018 | case 16: |
||
1982 | holgerb | 1019 | if(HottKeyboard == HOTT_KEY_SET) { if(show_poti) show_poti = 0; else show_poti = 1; Hott_ClearLine(6); Hott_ClearLine(7);} |
1020 | else |
||
2527 | holgerb | 1021 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;} |
2418 | holgerb | 1022 | else |
2527 | holgerb | 1023 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;}; |
1921 | holgerb | 1024 | HottKeyboard = 0; |
1025 | break; |
||
1933 | holgerb | 1026 | default: line = 0; |
1917 | holgerb | 1027 | break; |
1028 | } |
||
2420 | holgerb | 1029 | break; |
1030 | case 3: |
||
2418 | holgerb | 1031 | switch(line++) |
1032 | { |
||
2438 | holgerb | 1033 | static unsigned char load_waypoint_tmp2 = 1, changed2; |
2418 | holgerb | 1034 | case 0: |
1035 | HoTT_printfxy(0,0,"Load Waypoints"); |
||
2420 | holgerb | 1036 | HoTT_printfxy(0,1,"(Relative Positions)"); |
1037 | // HoTT_printfxy(0,1,"(Absolute)"); |
||
2418 | holgerb | 1038 | break; |
2420 | holgerb | 1039 | case 1: |
2692 | holgerb | 1040 | if(FlyzonePointCnt) HoTT_printfxy(0,5,"Flyzone:%2d points",FlyzonePointCnt) else Hott_ClearLine(5); |
2420 | holgerb | 1041 | if(NaviData_WaypointNumber) HoTT_printfxy(0,6,"Active WP:%2d/%d ",NaviData_WaypointIndex,NaviData_WaypointNumber) |
1042 | else HoTT_printfxy(0,6,"No WPs active ") |
||
2418 | holgerb | 1043 | break; |
1044 | case 2: |
||
2420 | holgerb | 1045 | HoTT_printfxy(0,7,"%2i.%1iV ",UBat/10, UBat%10) |
2424 | holgerb | 1046 | HoTT_printfxy(11,7,"%s",WPL_Name) |
2420 | holgerb | 1047 | case 3: |
1048 | case 4: |
||
1049 | case 5: |
||
1050 | if(load_waypoint_tmp2) |
||
2418 | holgerb | 1051 | { |
2420 | holgerb | 1052 | if(changed2 && HoTTBlink) HoTT_printfxy(10,3," ") |
1053 | else HoTT_printfxy(10,3,"%2i ",load_waypoint_tmp2); |
||
1054 | HoTT_printfxy(0,3,"Load list:") |
||
2418 | holgerb | 1055 | } |
1056 | else |
||
1057 | { |
||
1058 | HoTT_printfxy(0,3,"Load list: -- "); |
||
1059 | } |
||
2420 | holgerb | 1060 | if(NaviData_MaxWpListIndex == 0) HoTT_printfxy(0,4,"No SD-Card ") |
1061 | else |
||
1062 | { |
||
2425 | holgerb | 1063 | if(GPSInfo.SatFix == SATFIX_3D) |
1064 | { |
||
1065 | if(changed2 && load_waypoint_tmp2) HoTT_printfxy(0,4,"(Set -> Load)") |
||
1066 | else HoTT_printfxy(0,4," "); |
||
1067 | if(HottKeyboard == HOTT_KEY_SET) { if(load_waypoint_tmp2) ToNC_Load_WP_List = load_waypoint_tmp2 | 128; changed2 = 0;} |
||
1068 | } else HoTT_printfxy(0,4,"!No GPS-Fix! "); |
||
2420 | holgerb | 1069 | } |
1070 | if(HottKeyboard == HOTT_KEY_UP && load_waypoint_tmp2 < NaviData_MaxWpListIndex) { changed2 = 1; load_waypoint_tmp2++;HoTTBlink = 0;} |
||
1071 | if(HottKeyboard == HOTT_KEY_DOWN && load_waypoint_tmp2 > 1) { changed2 = 1; load_waypoint_tmp2--;HoTTBlink = 0;}; |
||
2527 | holgerb | 1072 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;} |
1073 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;}; |
||
2418 | holgerb | 1074 | HottKeyboard = 0; |
1075 | break; |
||
1076 | default: line = 0; |
||
1077 | break; |
||
1078 | } |
||
2420 | holgerb | 1079 | break; |
1080 | case 4: |
||
2418 | holgerb | 1081 | switch(line++) |
1082 | { |
||
2438 | holgerb | 1083 | static unsigned char load_waypoint_tmp = 1, changed; |
2418 | holgerb | 1084 | case 0: |
1085 | HoTT_printfxy(0,0,"Load Waypoints"); |
||
2420 | holgerb | 1086 | HoTT_printfxy(0,1,"(Fixed Positions)"); |
2418 | holgerb | 1087 | break; |
2420 | holgerb | 1088 | case 1: |
2692 | holgerb | 1089 | if(FlyzonePointCnt) HoTT_printfxy(0,5,"Flyzone:%2d points",FlyzonePointCnt) else Hott_ClearLine(5); |
2420 | holgerb | 1090 | if(NaviData_WaypointNumber) HoTT_printfxy(0,6,"Active WP:%2d/%d ",NaviData_WaypointIndex,NaviData_WaypointNumber) |
1091 | else HoTT_printfxy(0,6,"No WPs active ") |
||
2418 | holgerb | 1092 | break; |
1093 | case 2: |
||
2420 | holgerb | 1094 | HoTT_printfxy(0,7,"%2i.%1iV ",UBat/10, UBat%10) |
2424 | holgerb | 1095 | HoTT_printfxy(11,7,"%s",WPL_Name) |
2420 | holgerb | 1096 | case 3: |
1097 | case 4: |
||
1098 | case 5: |
||
2438 | holgerb | 1099 | HoTT_printfxy(0,3,"Load list:") |
2420 | holgerb | 1100 | if(load_waypoint_tmp) |
2418 | holgerb | 1101 | { |
2420 | holgerb | 1102 | if(changed && HoTTBlink) HoTT_printfxy(10,3," ") |
1103 | else HoTT_printfxy(10,3,"%2d (FIX)",load_waypoint_tmp); |
||
2418 | holgerb | 1104 | } |
1105 | else |
||
1106 | { |
||
2438 | holgerb | 1107 | HoTT_printfxy(10,3," --") |
2418 | holgerb | 1108 | } |
2420 | holgerb | 1109 | |
1110 | if(NaviData_MaxWpListIndex == 0) HoTT_printfxy(0,4,"No SD-Card ") |
||
1111 | else |
||
1112 | { |
||
2425 | holgerb | 1113 | if(changed && load_waypoint_tmp) HoTT_printfxy(0,4,"(Set -> Load)") |
1114 | else HoTT_printfxy(0,4," "); |
||
1115 | } |
||
2420 | holgerb | 1116 | if(HottKeyboard == HOTT_KEY_UP && load_waypoint_tmp < NaviData_MaxWpListIndex) { changed = 1; load_waypoint_tmp++; HoTTBlink = 0;} |
1117 | if(HottKeyboard == HOTT_KEY_DOWN && load_waypoint_tmp > 1) { changed = 1; load_waypoint_tmp--; HoTTBlink = 0;}; |
||
1118 | if(HottKeyboard == HOTT_KEY_SET) { if(load_waypoint_tmp) ToNC_Load_WP_List = load_waypoint_tmp; changed = 0;} |
||
2438 | holgerb | 1119 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;} |
1120 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;}; |
||
2418 | holgerb | 1121 | HottKeyboard = 0; |
1122 | break; |
||
1123 | default: line = 0; |
||
1124 | break; |
||
1125 | } |
||
2420 | holgerb | 1126 | break; |
2438 | holgerb | 1127 | case 5: |
1128 | switch(line++) |
||
1129 | { |
||
1130 | static unsigned char wp_tmp, changed; |
||
1131 | case 0: |
||
1132 | HoTT_printfxy(0,0,"Store single Position"); |
||
1133 | // HoTT_printfxy(0,1,"(Fixed Positions)"); |
||
1134 | break; |
||
1135 | case 1: |
||
1136 | HoTT_printfxy(0,2," %2i.%1iV ",UBat/10, UBat%10) |
||
1137 | HoTT_printfxy(0,3," %2i:%02i ",FlugSekunden/60,FlugSekunden%60); |
||
1138 | // HoTT_printfxy(0,4,"Dist:%3dm",NaviData_TargetDistance) |
||
1139 | break; |
||
1140 | case 2: |
||
1141 | HoTT_printfxy(11,2,"ALT:%4im", (int16_t)(HoehenWert/100)) |
||
1142 | HoTT_printfxy(11,3,"DIR: %3d%c",CompassCorrected, HoTT_GRAD); |
||
1143 | HoTT_printfxy(11,4,"Cam: %3i",Parameter_ServoNickControl); |
||
1144 | break; |
||
1145 | case 3: |
||
1146 | case 4: |
||
1147 | case 5: |
||
1148 | HoTT_printfxy(0,6,"Store point:") |
||
1149 | if(wp_tmp) |
||
1150 | { |
||
1151 | if(changed && HoTTBlink) HoTT_printfxy(13,6," ") |
||
1152 | else HoTT_printfxy(13,6,"%2d ",wp_tmp); |
||
1153 | } |
||
1154 | else |
||
1155 | { |
||
2439 | holgerb | 1156 | HoTT_printfxy(13,6,"--") |
2438 | holgerb | 1157 | } |
2439 | holgerb | 1158 | |
1159 | if(GPSInfo.SatFix == SATFIX_3D) |
||
1160 | { |
||
2438 | holgerb | 1161 | if(NaviData_MaxWpListIndex == 0) HoTT_printfxy(0,7,"No SD-Card ") |
1162 | else |
||
1163 | { |
||
1164 | if(changed && wp_tmp) HoTT_printfxy(0,7,"(Set -> Store)") |
||
1165 | else Hott_ClearLine(7); |
||
1166 | } |
||
2439 | holgerb | 1167 | if(HottKeyboard == HOTT_KEY_SET) { if(wp_tmp) ToNC_Store_SingePoint = wp_tmp; changed = 0;} |
1168 | } |
||
1169 | else HoTT_printfxy(0,7,"!No GPS-Fix! "); |
||
1170 | |||
2438 | holgerb | 1171 | if(HottKeyboard == HOTT_KEY_UP && wp_tmp < NaviData_MaxWpListIndex) { changed = 1; wp_tmp++; HoTTBlink = 0;} |
1172 | if(HottKeyboard == HOTT_KEY_DOWN && wp_tmp > 1) { changed = 1; wp_tmp--; HoTTBlink = 0;}; |
||
1173 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;} |
||
1174 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;}; |
||
1175 | HottKeyboard = 0; |
||
2554 | holgerb | 1176 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1177 | // Bedienung per Taster am Sender |
||
2575 | holgerb | 1178 | if(PPM_in[EE_Parameter.MenuKeyChannel] > 50) // |
2554 | holgerb | 1179 | { |
2561 | holgerb | 1180 | hyterese = 2; |
1181 | if(CheckDelay(delay)) { wp_tmp = 0; hyterese = 1;} |
||
1182 | } |
||
1183 | else |
||
2575 | holgerb | 1184 | if(PPM_in[EE_Parameter.MenuKeyChannel] < -50) |
2561 | holgerb | 1185 | { |
1186 | delay = SetDelay(2500); |
||
1187 | if(hyterese == 2 && (wp_tmp < NaviData_MaxWpListIndex)) |
||
2554 | holgerb | 1188 | { |
1189 | wp_tmp++; |
||
1190 | ToNC_Store_SingePoint = wp_tmp; |
||
1191 | changed = 0; |
||
1192 | } |
||
1193 | hyterese = 0; |
||
1194 | } |
||
1195 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
2438 | holgerb | 1196 | break; |
1197 | default: line = 0; |
||
1198 | break; |
||
1199 | } |
||
1200 | break; |
||
1201 | case 6: |
||
1202 | switch(line++) |
||
1203 | { |
||
1204 | static unsigned char wp_tmp, changed; |
||
1205 | case 0: |
||
1206 | HoTT_printfxy(0,0,"Load single Position"); |
||
1207 | // HoTT_printfxy(0,1,"(Fixed Positions)"); |
||
1208 | break; |
||
1209 | case 1: |
||
1210 | HoTT_printfxy(0,2," %2i.%1iV ",UBat/10, UBat%10) |
||
1211 | HoTT_printfxy(0,3," %2i:%02i ",FlugSekunden/60,FlugSekunden%60); |
||
1212 | // HoTT_printfxy(0,4,"Dist:%3dm",NaviData_TargetDistance) |
||
2439 | holgerb | 1213 | if(NaviData_WaypointNumber) HoTT_printfxy(0,5,"WP:%2d/%d Dist:%3dm ",NaviData_WaypointIndex,NaviData_WaypointNumber,NaviData_TargetDistance) |
2438 | holgerb | 1214 | else Hott_ClearLine(5); |
1215 | break; |
||
1216 | case 2: |
||
2439 | holgerb | 1217 | if(FromNC_AltitudeSpeed) |
1218 | HoTT_printfxy(8,2,"ALT:%4i/%im ", (int16_t)(HoehenWert/100),(int16_t)(FromNC_AltitudeSetpoint/100)) |
||
1219 | else |
||
1220 | HoTT_printfxy(8,2,"ALT:%4im ",(int16_t)(HoehenWert/100)) |
||
1221 | |||
1222 | HoTT_printfxy(8,3,"DIR: %3d%c",CompassCorrected, HoTT_GRAD); |
||
1223 | HoTT_printfxy(8,4,"Cam: %3i",Parameter_ServoNickControl); |
||
2438 | holgerb | 1224 | break; |
1225 | // HoTT_printfxy(11,7,"%s",WPL_Name) |
||
1226 | case 3: |
||
2440 | holgerb | 1227 | case 4: |
2438 | holgerb | 1228 | case 5: |
1229 | HoTT_printfxy(0,6,"load point:") |
||
1230 | if(wp_tmp) |
||
1231 | { |
||
1232 | if(changed && HoTTBlink) HoTT_printfxy(11,6," ") |
||
1233 | else HoTT_printfxy(11,6,"%2d",wp_tmp); |
||
1234 | } |
||
1235 | else |
||
1236 | { |
||
2440 | holgerb | 1237 | HoTT_printfxy(11,6,"--") |
2438 | holgerb | 1238 | } |
1239 | |||
1240 | if(NaviData_MaxWpListIndex == 0) HoTT_printfxy(0,7,"No SD-Card ") |
||
1241 | else |
||
1242 | { |
||
1243 | if(changed && wp_tmp) HoTT_printfxy(0,7,"(Set -> Load)") |
||
2439 | holgerb | 1244 | else |
1245 | { |
||
1246 | Hott_ClearLine(7); |
||
1247 | if(NaviData_WaypointNumber) HoTT_printfxy(0,7,"%s",WPL_Name); |
||
1248 | } |
||
2438 | holgerb | 1249 | } |
1250 | if(HottKeyboard == HOTT_KEY_UP && wp_tmp < NaviData_MaxWpListIndex) { changed = 1; wp_tmp++; HoTTBlink = 0;} |
||
1251 | if(HottKeyboard == HOTT_KEY_DOWN && wp_tmp > 1) { changed = 1; wp_tmp--; HoTTBlink = 0;}; |
||
1252 | if(HottKeyboard == HOTT_KEY_SET) { if(wp_tmp) ToNC_Load_SingePoint = wp_tmp; changed = 0;} |
||
2527 | holgerb | 1253 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;} |
2438 | holgerb | 1254 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;}; |
1255 | HottKeyboard = 0; |
||
2554 | holgerb | 1256 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1257 | // Bedienung per Taster am Sender |
||
2575 | holgerb | 1258 | if(PPM_in[EE_Parameter.MenuKeyChannel] > 50) // |
2554 | holgerb | 1259 | { |
2561 | holgerb | 1260 | hyterese = 2; |
1261 | if(CheckDelay(delay)) { wp_tmp = 0; hyterese = 1;} |
||
1262 | } |
||
1263 | else |
||
2575 | holgerb | 1264 | if(PPM_in[EE_Parameter.MenuKeyChannel] < -50) |
2561 | holgerb | 1265 | { |
1266 | delay = SetDelay(2500); |
||
1267 | if(hyterese == 2 && (wp_tmp < NaviData_MaxWpListIndex)) |
||
2554 | holgerb | 1268 | { |
1269 | wp_tmp++; |
||
1270 | ToNC_Load_SingePoint = wp_tmp; |
||
1271 | changed = 0; |
||
1272 | } |
||
1273 | hyterese = 0; |
||
1274 | } |
||
1275 | // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
||
2438 | holgerb | 1276 | break; |
1277 | default: line = 0; |
||
1278 | break; |
||
1279 | } |
||
1280 | break; |
||
2527 | holgerb | 1281 | case 7: |
1282 | switch(line++) |
||
1283 | { |
||
1284 | static unsigned char i=0,test=0,set=0; |
||
1285 | |||
1286 | case 0: HoTT_printfxy(0,0,"Motortest / Setpoints");break; |
||
1287 | case 1: //HoTT_printfxy(0,1,"Motor Setpoint Strom "); |
||
1288 | case 2: |
||
1289 | case 3: |
||
1290 | case 4: i=((line-2)*2)+1; |
||
1291 | if(MotorenEin) |
||
1292 | { |
||
1293 | HoTT_printfxy(0,line,"M%i=%2i%2i.%iA M%i=%2i%2i.%iA",i,Motor[i-1].SetPoint,Motor[i-1].Current/10,Motor[i-1].Current%10,i+1,Motor[i].SetPoint,Motor[i].Current/10,Motor[i].Current%10); |
||
1294 | } |
||
1295 | else |
||
1296 | { |
||
1297 | HoTT_printfxy(0,line,"M%i=%2i%2i.%iA M%i=%2i%2i.%iA",i,MotorTest[i-1],Motor[i-1].Current/10,Motor[i-1].Current%10,i+1,MotorTest[i],Motor[i].Current/10,Motor[i].Current%10); |
||
1298 | } |
||
1299 | break; |
||
1300 | case 5: if(test) |
||
1301 | { |
||
1302 | HoTT_printfxy(0,6,"!!!Motortest Aktiv!!!"); |
||
1303 | } |
||
1304 | case 6: if(test) |
||
1305 | { |
||
1306 | PC_MotortestActive = 254; |
||
1307 | HoTT_printfxy(0,7,"Motor %i",test); |
||
1308 | MotorTest[test-1]=set; |
||
1309 | } |
||
1310 | case 7: |
||
1311 | case 8: |
||
1312 | case 9: |
||
1313 | case 10: |
||
1314 | case 11: |
||
1315 | case 12: |
||
1316 | case 13: |
||
1317 | case 14: |
||
1318 | case 15: |
||
1319 | case 16: |
||
1320 | if(HottKeyboard == HOTT_KEY_RIGHT) |
||
1321 | { |
||
1322 | if(test) |
||
1323 | { |
||
1324 | set=0; |
||
1325 | MotorTest[test-1]=set; |
||
1326 | if(test<8) test++; |
||
1327 | } |
||
1328 | else |
||
1329 | { |
||
1330 | LIBFC_HoTT_Clear(); |
||
1331 | page--; |
||
1332 | line=0; |
||
1333 | } |
||
1334 | } |
||
1335 | else |
||
1336 | if(HottKeyboard == HOTT_KEY_LEFT) |
||
1337 | { |
||
1338 | if(test) |
||
1339 | { |
||
1340 | set=0; |
||
1341 | MotorTest[test-1]=set; |
||
1342 | if(test>1) test--; |
||
1343 | } |
||
1344 | else |
||
1345 | { |
||
1346 | LIBFC_HoTT_Clear(); |
||
1347 | page++; |
||
1348 | line = 0; |
||
1349 | } |
||
1350 | } |
||
1351 | else |
||
1352 | if((HottKeyboard == HOTT_KEY_UP) && (set <98 ) && test) set+=2;//GESCHW |
||
1353 | else |
||
1354 | if((HottKeyboard == HOTT_KEY_DOWN) && (set >0 ) && test) set-=2; |
||
1355 | else |
||
1356 | if((HottKeyboard == HOTT_KEY_SET) && !MotorenEin) |
||
1357 | { |
||
1358 | if(test) test = 0; else test = 1; |
||
1359 | set=0; |
||
1360 | Hott_ClearLine(6); Hott_ClearLine(7); |
||
1361 | } |
||
1362 | HottKeyboard = 0; |
||
1363 | break; |
||
1364 | default: line = 0; |
||
1365 | break; |
||
1366 | //HoTT_printfxy(10 ,line,"I"); |
||
1367 | //line++; |
||
1368 | } |
||
1369 | break; |
||
1370 | case 8: |
||
1371 | switch(line++) |
||
1372 | { |
||
1373 | #define MD_OFF 1 |
||
1374 | #define MD_CAL 2 |
||
1375 | #define MD_SAV 3 |
||
1376 | static unsigned char mode=MD_OFF,cursor=MD_OFF; |
||
1377 | |||
1378 | case 0: HoTT_printfxy(0,0,"ACC calibration");break; |
||
2537 | holgerb | 1379 | case 1: HoTT_printfxy(0,2,"ACC: N:%3i R:%3i ",NeutralAccX,NeutralAccY); |
1380 | case 2: HoTT_printfxy(0,3,"Stick: (%i/%i) ",ChannelNick,ChannelRoll); |
||
1381 | case 3: if(ChannelNick || ChannelRoll) HoTT_printfxy(7,3,"!!"); |
||
1382 | break; |
||
2527 | holgerb | 1383 | case 4: HoTT_printfxy(2,4,"Off");break; |
1384 | case 5: HoTT_printfxy(2,5,"Calibrate");break; |
||
2537 | holgerb | 1385 | case 6: HoTT_printfxy(2,6,"Save "); |
1386 | if(mode == MD_SAV && cursor == MD_SAV) |
||
1387 | { |
||
1388 | HoTT_printfxy(7,6,"(SET)"); |
||
1389 | } |
||
1390 | else if((mode == MD_CAL) && !((NC_GPS_ModeCharacter == ' ') || (NC_GPS_ModeCharacter == '/') || (NC_GPS_ModeCharacter == '-'))) |
||
1391 | { |
||
1392 | HoTT_printfxy(2,6,"Swich GPS off!"); |
||
1393 | } |
||
2527 | holgerb | 1394 | break; |
1395 | case 7: |
||
1396 | case 8: HoTT_printfxy(0,cursor+3,">");break; |
||
1397 | case 9: HoTT_printfxy(1,mode+3,"*");break; |
||
1398 | case 10: |
||
1399 | case 11: |
||
1400 | case 12: |
||
1401 | case 13: |
||
1402 | case 14: |
||
1403 | case 15: |
||
1404 | case 16: |
||
1405 | if(HottKeyboard == HOTT_KEY_RIGHT) |
||
1406 | { |
||
1407 | switch(mode) |
||
1408 | { |
||
1409 | case MD_OFF: LIBFC_HoTT_Clear(); |
||
1410 | page--; // leave menu |
||
1411 | line = 0; |
||
1412 | break; |
||
1413 | case MD_CAL: NeutralAccY++; |
||
1414 | break; |
||
1415 | case MD_SAV: break; |
||
1416 | default: mode=MD_OFF;break; |
||
1417 | } |
||
1418 | } |
||
1419 | else |
||
1420 | if(HottKeyboard == HOTT_KEY_LEFT) |
||
1421 | { |
||
1422 | switch(mode) |
||
1423 | { |
||
1424 | case MD_OFF: LIBFC_HoTT_Clear(); |
||
1425 | page++; // leave menu |
||
1426 | line = 0; |
||
1427 | break; |
||
1428 | case MD_CAL: NeutralAccY--; |
||
1429 | break; |
||
1430 | case MD_SAV: break; |
||
1431 | default: mode=MD_OFF; |
||
1432 | break; |
||
1433 | } |
||
1434 | } |
||
1435 | else |
||
1436 | if(HottKeyboard == HOTT_KEY_UP) |
||
1437 | { |
||
1438 | switch(mode) |
||
1439 | { |
||
1440 | case MD_CAL: NeutralAccX++; |
||
1441 | break; |
||
1442 | case MD_OFF: |
||
1443 | case MD_SAV: if(cursor>1) {HoTT_printfxy(0,cursor+3," ");cursor--;} |
||
1444 | HoTT_printfxy(2,6," "); |
||
1445 | break; |
||
1446 | default: mode=MD_OFF; |
||
1447 | break; |
||
1448 | } |
||
1449 | } |
||
1450 | else |
||
1451 | if(HottKeyboard == HOTT_KEY_DOWN) |
||
1452 | { |
||
1453 | switch(mode) |
||
1454 | { |
||
1455 | case MD_CAL: NeutralAccX--; |
||
1456 | break; |
||
1457 | case MD_SAV: |
||
1458 | case MD_OFF: if(cursor<MD_SAV) {HoTT_printfxy(0,cursor+3," ");cursor++;} |
||
1459 | break; |
||
1460 | default: mode=MD_OFF; |
||
1461 | break; |
||
1462 | } |
||
1463 | } |
||
1464 | else |
||
1465 | if(HottKeyboard == HOTT_KEY_SET) |
||
1466 | { |
||
1467 | switch(mode) |
||
1468 | { |
||
1469 | case MD_OFF: HoTT_printfxy(1,mode+3," "); |
||
1470 | mode = cursor; |
||
1471 | if(mode == MD_CAL && !EE_Parameter.Driftkomp) EE_Parameter.Driftkomp = 6; // enables the Gyro-Drift compensation to make sure that a litlte calibration error won't effect the attitude |
||
1472 | break; |
||
1473 | case MD_CAL: HoTT_printfxy(1,mode+3," "); |
||
1474 | mode = MD_OFF; |
||
1475 | break; |
||
1476 | case MD_SAV: |
||
1477 | Hott_ClearLine(7); |
||
1478 | if(cursor == MD_SAV) |
||
1479 | { |
||
1480 | if(!MotorenEin) |
||
1481 | { |
||
2537 | holgerb | 1482 | /* BoatNeutralNick = AdNeutralNick; |
1483 | BoatNeutralRoll = AdNeutralRoll; |
||
1484 | BoatNeutralGier = AdNeutralGier; |
||
2527 | holgerb | 1485 | SetParamWord(PID_ACC_NICK, (uint16_t)NeutralAccX); |
1486 | SetParamWord(PID_ACC_ROLL, (uint16_t)NeutralAccY); |
||
1487 | SetParamWord(PID_GYRO_NICK,(uint16_t)BoatNeutralNick); |
||
1488 | SetParamWord(PID_GYRO_ROLL,(uint16_t)BoatNeutralRoll); |
||
1489 | SetParamWord(PID_GYRO_YAW,(uint16_t)BoatNeutralGier); |
||
2537 | holgerb | 1490 | */ |
1491 | StoreNeutralToEeprom(); |
||
2527 | holgerb | 1492 | HoTT_printfxy(7,6," okay "); |
1493 | HoTT_printfxy(1,mode+3," "); |
||
1494 | mode = MD_OFF; |
||
1495 | } |
||
1496 | else |
||
1497 | { |
||
1498 | HoTT_printfxy(0,7,"Motors running!!!"); |
||
1499 | mode = MD_OFF; |
||
1500 | } |
||
1501 | } |
||
1502 | else |
||
1503 | { |
||
1504 | HoTT_printfxy(1,mode+3," "); |
||
1505 | mode=cursor; |
||
1506 | } |
||
1507 | break; |
||
1508 | default: mode=MD_OFF; |
||
1509 | break; |
||
1510 | } |
||
1511 | } |
||
1512 | HottKeyboard = 0; |
||
1513 | break; |
||
1514 | default: line = 0; |
||
1515 | break; |
||
1516 | //HoTT_printfxy(10 ,line,"I"); |
||
1517 | //line++; |
||
1518 | } |
||
1519 | break; |
||
1520 | /* |
||
1521 | //------------------------------------------------------------------------------------------ |
||
1522 | // HoTT-Plus |
||
1523 | //------------------------------------------------------------------------------------------ |
||
1524 | case 9: |
||
1525 | switch(line++) |
||
1526 | { |
||
1527 | case 0: HoTT_printfxy(0,0,"I2C Schwerpunkt GAS"); |
||
1528 | break; |
||
1529 | case 1: HoTT_printfxy(0,1,"I2C%3i%3i%3i%3i",Motor[0].State & MOTOR_STATE_ERROR_MASK,Motor[1].State & MOTOR_STATE_ERROR_MASK, Motor[2].State & MOTOR_STATE_ERROR_MASK, Motor[3].State & MOTOR_STATE_ERROR_MASK); |
||
1530 | break; |
||
1531 | case 2: HoTT_printfxy(0,2," %3i%3i%3i%3i",Motor[4].State & MOTOR_STATE_ERROR_MASK,Motor[5].State & MOTOR_STATE_ERROR_MASK, Motor[6].State & MOTOR_STATE_ERROR_MASK, Motor[7].State & MOTOR_STATE_ERROR_MASK); |
||
1532 | break; |
||
1533 | |||
1534 | case 3: { //0123456789ABCDEF |
||
1535 | int r=0; |
||
1536 | int n=0; |
||
1537 | int g=0; |
||
1538 | n=SummeNick >> 9; |
||
1539 | r=SummeRoll >> 9; |
||
1540 | g=Mess_Integral_Gier >> 9; |
||
1541 | |||
1542 | HoTT_printfxy(0,5,"%3iN %3iR %3iG",n ,r ,g); |
||
1543 | } |
||
1544 | |||
1545 | break; |
||
1546 | case 4: { //0123456789ABCDEF |
||
1547 | HoTT_printfxy(0,4,"+ ^ + <"); |
||
1548 | } |
||
1549 | break; |
||
1550 | case 5: { //0123456789ABCDEF |
||
1551 | HoTT_printfxy(0,6,"- v - >"); |
||
1552 | } |
||
1553 | break; |
||
1554 | case 6: HoTT_printfxy(0,7,"%3i=HG/4 %3i=Gas",HoverGas/4,StickGas); |
||
1555 | |||
1556 | break; |
||
1557 | case 7: |
||
1558 | case 8: |
||
1559 | case 9: |
||
1560 | case 10: |
||
1561 | case 11: |
||
1562 | case 12: |
||
1563 | case 13: |
||
1564 | case 14: |
||
1565 | case 15: |
||
1566 | case 16: |
||
1567 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;} |
||
1568 | else |
||
1569 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;} |
||
1570 | HottKeyboard = 0; |
||
1571 | break; |
||
1572 | default: line = 0; |
||
1573 | break; |
||
1574 | } |
||
1575 | break; |
||
1576 | //--------------------------------------------------------------------------------------------------- |
||
1577 | case 10: |
||
1578 | { |
||
1579 | static signed char i=0,j=0,Changepos=0; |
||
1580 | |||
1581 | if(line==9) |
||
1582 | { |
||
1583 | line=0; |
||
1584 | if(HottKeyboard == HOTT_KEY_SET ) { if(Changepos) Changepos = 0; else Changepos = 1;} |
||
1585 | else |
||
1586 | if(Changepos) |
||
1587 | { |
||
1588 | unsigned char temp=0; |
||
1589 | temp=(Changepos+j)-1; |
||
1590 | if((HottKeyboard == HOTT_KEY_RIGHT) && !((unsigned char)(*Parameter_List[temp].Variable + Parameter_List[temp].offset) >= Parameter_List[temp].max )) {*Parameter_List[temp].Variable += 1;} |
||
1591 | else |
||
1592 | if((HottKeyboard == HOTT_KEY_LEFT) && !((unsigned char)(*Parameter_List[temp].Variable + Parameter_List[temp].offset) <= Parameter_List[temp].min )) {*Parameter_List[temp].Variable -= 1;} |
||
1593 | else |
||
1594 | if(HottKeyboard == HOTT_KEY_UP ) |
||
1595 | { |
||
1596 | Changepos--; |
||
1597 | line = Changepos/2; |
||
1598 | if(Changepos< 1 ) {Changepos=16;} |
||
1599 | } |
||
1600 | else |
||
1601 | if(HottKeyboard == HOTT_KEY_DOWN) |
||
1602 | { |
||
1603 | Changepos++; |
||
1604 | line = Changepos/2; |
||
1605 | if(Changepos >= 17 ) {Changepos=1;} |
||
1606 | } |
||
1607 | } |
||
1608 | else |
||
1609 | { |
||
1610 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;} |
||
1611 | else |
||
1612 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;} |
||
1613 | else |
||
1614 | if(HottKeyboard == HOTT_KEY_UP ) |
||
1615 | { |
||
1616 | j-=16; |
||
1617 | line = 0; |
||
1618 | if(j< 0 ) {j=0;} |
||
1619 | } |
||
1620 | else |
||
1621 | if(HottKeyboard == HOTT_KEY_DOWN) |
||
1622 | { |
||
1623 | LIBFC_HoTT_Clear(); |
||
1624 | j+=16; |
||
1625 | line = 0; |
||
1626 | if(j+14> MAXPARAM ) {j=MAXPARAM-15;} |
||
1627 | } |
||
1628 | } |
||
1629 | |||
1630 | Debug("line=%i Changepos=%i j=%i Key=%i",line,Changepos,j,HottKeyboard); |
||
1631 | HottKeyboard = 0; |
||
1632 | } |
||
1633 | |||
1634 | HoTT_printfxy(10 ,line,"I"); |
||
1635 | i=(line*2)+(j); |
||
1636 | if(Changepos==(line*2)+1) |
||
1637 | { |
||
1638 | HoTT_printfxy(0 ,line,">%3i=%-5.5s%",(unsigned char)(*Parameter_List[i ].Variable + Parameter_List[i ].offset),&Parameter_List[i ].name); |
||
1639 | } |
||
1640 | else |
||
1641 | { |
||
1642 | HoTT_printfxy(0 ,line," %3i=%-5.5s%",(unsigned char)(*Parameter_List[i ].Variable + Parameter_List[i ].offset),&Parameter_List[i ].name); |
||
1643 | } |
||
1644 | if(Changepos==(line*2)+2) |
||
1645 | { |
||
1646 | HoTT_printfxy(11,line,">%3i=%-5.5s%",(unsigned char)(*Parameter_List[i+1].Variable + Parameter_List[i+1].offset),&Parameter_List[i+1].name); |
||
1647 | } |
||
1648 | else |
||
1649 | { |
||
1650 | HoTT_printfxy(11,line," %3i=%-5.5s%",(unsigned char)(*Parameter_List[i+1].Variable + Parameter_List[i+1].offset),&Parameter_List[i+1].name); |
||
1651 | } |
||
1652 | |||
1653 | line++; |
||
1654 | |||
1655 | } |
||
1656 | break; |
||
1657 | case 11: |
||
1658 | switch(line++) |
||
1659 | { |
||
1660 | case 0: HoTT_printfxy(0,0,"Setting speichern"); |
||
1661 | break; |
||
1662 | case 1: HoTT_printfxy(0,1,"Setting%1i= %-11.11s",GetActiveParamSet(),EE_Parameter.Name); |
||
1663 | break; //123456789012345678901 |
||
1664 | case 2: HoTT_printfxy(0,2,"Speichern nach Set %i",settingdest); |
||
1665 | break; |
||
1666 | case 3: HoTT_printfxy(0,4,"\"SET\" zum speichern"); |
||
1667 | break; |
||
1668 | case 4: HoTT_printfxy(0,5,"^ v zum auswaehlen"); |
||
1669 | break; |
||
2545 | holgerb | 1670 | case 5: |
1671 | case 6: |
||
2527 | holgerb | 1672 | case 7: |
1673 | case 8: |
||
1674 | case 9: |
||
1675 | case 10: |
||
1676 | case 11: |
||
1677 | case 12: |
||
1678 | case 13: |
||
1679 | case 14: |
||
1680 | case 15: |
||
1681 | case 16: |
||
1682 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;} |
||
1683 | else |
||
1684 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;} |
||
1685 | else |
||
1686 | if((HottKeyboard == HOTT_KEY_UP) & (settingdest <5 )) settingdest++; |
||
1687 | else |
||
1688 | if((HottKeyboard == HOTT_KEY_DOWN) & (settingdest >1 )) settingdest--; |
||
1689 | else |
||
1690 | if((HottKeyboard == HOTT_KEY_SET) && !MotorenEin) |
||
1691 | { |
||
1692 | ParamSet_WriteToEEProm(settingdest); |
||
1693 | //JetiBeep = jetibeepcode[GetActiveParamSet()-1]; |
||
1694 | Piep(GetActiveParamSet(),120); |
||
1695 | HoTT_printfxy(0,7,"Gespeichert!"); |
||
1696 | } |
||
1697 | HottKeyboard = 0; |
||
1698 | break; |
||
1699 | default: line = 0; |
||
1700 | break; |
||
1701 | } |
||
1702 | break; |
||
1703 | //------------------------------------------------------------------------------------------ |
||
1704 | // HoTT-Plus |
||
1705 | //------------------------------------------------------------------------------------------ |
||
1706 | */ |
||
2420 | holgerb | 1707 | default: page = 0; |
1708 | break; |
||
1709 | } |
||
1917 | holgerb | 1710 | } |
1711 | |||
1925 | holgerb | 1712 | #endif |
1917 | holgerb | 1713 | |
1714 | |||
1715 |