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