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