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