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