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