Rev 2408 | Rev 2420 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2408 | Rev 2418 | ||
---|---|---|---|
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 | #if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
59 | #if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__)) |
60 | 60 | ||
61 | #define HoTT_printf(format, args...) { _printf_P(&LIBFC_HoTT_Putchar, PSTR(format) , ## args);} |
61 | #define HoTT_printf(format, args...) { _printf_P(&LIBFC_HoTT_Putchar, PSTR(format) , ## args);} |
62 | #define HoTT_printfxy(x,y,format, args...) { LIBFC_HoTT_SetPos(y * 21 + x); _printf_P(&LIBFC_HoTT_Putchar, PSTR(format) , ## args);} |
62 | #define HoTT_printfxy(x,y,format, args...) { LIBFC_HoTT_SetPos(y * 21 + x); _printf_P(&LIBFC_HoTT_Putchar, PSTR(format) , ## args);} |
63 | #define HoTT_printfxy_INV(x,y,format, args...) { LIBFC_HoTT_SetPos(y * 21 + x); _printf_P(&LIBFC_HoTT_Putchar_INV, PSTR(format) , ## args);} |
63 | #define HoTT_printfxy_INV(x,y,format, args...) { LIBFC_HoTT_SetPos(y * 21 + x); _printf_P(&LIBFC_HoTT_Putchar_INV, PSTR(format) , ## args);} |
64 | #define HoTT_printfxy_BLINK(x,y,format, args...) { LIBFC_HoTT_SetPos(y * 21 + x); _printf_P(&LIBFC_HoTT_Putchar_BLINK, PSTR(format) , ## args);} |
64 | #define HoTT_printfxy_BLINK(x,y,format, args...) { LIBFC_HoTT_SetPos(y * 21 + x); _printf_P(&LIBFC_HoTT_Putchar_BLINK, PSTR(format) , ## args);} |
65 | #define HoTT_printf_BLINK(format, args...) { _printf_P(&LIBFC_HoTT_Putchar_BLINK, PSTR(format) , ## args);} |
65 | #define HoTT_printf_BLINK(format, args...) { _printf_P(&LIBFC_HoTT_Putchar_BLINK, PSTR(format) , ## args);} |
66 | #define HoTT_printf_INV(format, args...) { _printf_P(&LIBFC_HoTT_Putchar_INV, PSTR(format) , ## args);} |
66 | #define HoTT_printf_INV(format, args...) { _printf_P(&LIBFC_HoTT_Putchar_INV, PSTR(format) , ## args);} |
67 | 67 | ||
68 | #define VOICE_MINIMALE_EINGANSSPANNUNG 16 |
68 | #define VOICE_MINIMALE_EINGANSSPANNUNG 16 |
69 | #define VOICE_BEEP 5 |
69 | #define VOICE_BEEP 5 |
70 | #define HoTT_GRAD 96 |
70 | #define HoTT_GRAD 96 |
71 | #define HoTT_LINKS 123 |
71 | #define HoTT_LINKS 123 |
72 | #define HoTT_RECHTS 124 |
72 | #define HoTT_RECHTS 124 |
73 | #define HoTT_OBEN 125 |
73 | #define HoTT_OBEN 125 |
74 | #define HoTT_UNTEN 126 |
74 | #define HoTT_UNTEN 126 |
75 | 75 | ||
76 | #define HOTT_KEY_RIGHT 1 |
76 | #define HOTT_KEY_RIGHT 1 |
77 | #define HOTT_KEY_DOWN 2 |
77 | #define HOTT_KEY_DOWN 2 |
78 | #define HOTT_KEY_UP 4 |
78 | #define HOTT_KEY_UP 4 |
79 | #define HOTT_KEY_SET 6 |
79 | #define HOTT_KEY_SET 6 |
80 | #define HOTT_KEY_LEFT 8 |
80 | #define HOTT_KEY_LEFT 8 |
81 | 81 | ||
82 | #define VARIO_ZERO 30000 |
82 | #define VARIO_ZERO 30000 |
83 | unsigned char NaviData_WaypointIndex = 0, NaviData_WaypointNumber = 0, NaviData_TargetHoldTime = 0; |
83 | unsigned char NaviData_WaypointIndex = 0, NaviData_WaypointNumber = 0, NaviData_TargetHoldTime = 0, ToNC_Load_WP_List = 0; |
84 | unsigned int NaviData_TargetDistance = 0; |
84 | unsigned int NaviData_TargetDistance = 0; |
85 | 85 | ||
86 | unsigned char MaxBlTemperture = 0; |
86 | unsigned char MaxBlTemperture = 0; |
87 | unsigned char MinBlTemperture = 0; |
87 | unsigned char MinBlTemperture = 0; |
88 | unsigned char HottestBl = 0; |
88 | unsigned char HottestBl = 0; |
89 | 89 | ||
90 | GPSPacket_t GPSPacket; |
90 | GPSPacket_t GPSPacket; |
91 | VarioPacket_t VarioPacket; |
91 | VarioPacket_t VarioPacket; |
92 | ASCIIPacket_t ASCIIPacket; |
92 | ASCIIPacket_t ASCIIPacket; |
93 | ElectricAirPacket_t ElectricAirPacket; |
93 | ElectricAirPacket_t ElectricAirPacket; |
94 | HoTTGeneral_t HoTTGeneral; |
94 | HoTTGeneral_t HoTTGeneral; |
95 | unsigned char SpeakHoTT = SPEAK_MIKROKOPTER; |
95 | unsigned char SpeakHoTT = SPEAK_MIKROKOPTER; |
96 | unsigned char ToNC_SpeakHoTT = 0, ShowSettingNameTime = 0; |
96 | unsigned char ToNC_SpeakHoTT = 0, ShowSettingNameTime = 0; |
97 | int HoTTVarioMeter = 0; |
97 | int HoTTVarioMeter = 0; |
98 | const char PROGMEM MIKROKOPTER[] = {" MikroKopter "}; |
98 | const char PROGMEM MIKROKOPTER[] = {" MikroKopter "}; |
99 | const char PROGMEM UNDERVOLTAGE[] = {" !! LiPo voltage !! "}; |
99 | const char PROGMEM UNDERVOLTAGE[] = {" !! LiPo voltage !! "}; |
100 | const char PROGMEM LANDING[] = {" !! LANDING !! "}; |
100 | const char PROGMEM LANDING[] = {" !! LANDING !! "}; |
101 | const char PROGMEM SETTING[] = {"Set :"}; |
101 | const char PROGMEM SETTING[] = {"Set :"}; |
102 | const char PROGMEM NC_ERROR_TEXT[MAX_ERR_NUMBER][17] = |
102 | const char PROGMEM NC_ERROR_TEXT[MAX_ERR_NUMBER][17] = |
103 | { |
103 | { |
104 | //0123456789123456 |
104 | //0123456789123456 |
105 | "No Error \0", // 0 |
105 | "No Error \0", // 0 |
106 | "Not compatible \0", // 1 |
106 | "Not compatible \0", // 1 |
107 | "MK3Mag not compa\0", // 2 |
107 | "MK3Mag not compa\0", // 2 |
108 | "No FC communicat\0", // 3 |
108 | "No FC communicat\0", // 3 |
109 | "Compass communic\0", // 4 |
109 | "Compass communic\0", // 4 |
110 | "GPS communicatio\0", // 5 |
110 | "GPS communicatio\0", // 5 |
111 | "compass value \0", // 6 |
111 | "compass value \0", // 6 |
112 | "RC Signal lost \0", // 7 |
112 | "RC Signal lost \0", // 7 |
113 | "FC spi rx error \0", // 8 |
113 | "FC spi rx error \0", // 8 |
114 | "No NC communicat\0", // 9 |
114 | "No NC communicat\0", // 9 |
115 | "FC Nick Gyro \0", // 10 |
115 | "FC Nick Gyro \0", // 10 |
116 | "FC Roll Gyro \0", // 11 |
116 | "FC Roll Gyro \0", // 11 |
117 | "FC Yaw Gyro \0", // 12 |
117 | "FC Yaw Gyro \0", // 12 |
118 | "FC Nick ACC \0", // 13 |
118 | "FC Nick ACC \0", // 13 |
119 | "FC Roll ACC \0", // 14 |
119 | "FC Roll ACC \0", // 14 |
120 | "FC Z-ACC \0", // 15 |
120 | "FC Z-ACC \0", // 15 |
121 | "Pressure sensor \0", // 16 |
121 | "Pressure sensor \0", // 16 |
122 | "I2C FC->BL-Ctrl \0", // 17 |
122 | "I2C FC->BL-Ctrl \0", // 17 |
123 | "Bl Missing \0", // 18 |
123 | "Bl Missing \0", // 18 |
124 | "Mixer Error \0", // 19 |
124 | "Mixer Error \0", // 19 |
125 | "Carefree Error \0", // 20 |
125 | "Carefree Error \0", // 20 |
126 | "GPS Fix lost \0", // 21 |
126 | "GPS Fix lost \0", // 21 |
127 | "Magnet Error \0", // 22 |
127 | "Magnet Error \0", // 22 |
128 | "Motor restart \0", // 23 |
128 | "Motor restart \0", // 23 |
129 | "BL Limitation \0", // 24 |
129 | "BL Limitation \0", // 24 |
130 | "GPS Range \0", // 25 |
130 | "GPS Range \0", // 25 |
131 | "No SD-Card \0", // 26 |
131 | "No SD-Card \0", // 26 |
132 | "SD-Logging error\0", // 27 |
132 | "SD-Logging error\0", // 27 |
133 | "Flying range! \0", // 28 |
133 | "Flying range! \0", // 28 |
134 | "Max Altitude! \0", // 29 |
134 | "Max Altitude! \0", // 29 |
135 | "No GPS fix \0", // 30 |
135 | "No GPS fix \0", // 30 |
136 | "compass not cal.\0", // 31 |
136 | "compass not cal.\0", // 31 |
137 | "BL-Selftest \0", // 32 |
137 | "BL-Selftest \0", // 32 |
138 | "no ext. compass \0", // 33 |
138 | "no ext. compass \0", // 33 |
139 | "compass sensor \0" // 34 |
139 | "compass sensor \0" // 34 |
140 | }; |
140 | }; |
141 | 141 | ||
142 | 142 | ||
143 | const char PROGMEM HOTT_ERROR[MAX_ERR_NUMBER][2] = |
143 | const char PROGMEM HOTT_ERROR[MAX_ERR_NUMBER][2] = |
144 | { // 1 -> only in flight 0 -> also on ground |
144 | { // 1 -> only in flight 0 -> also on ground |
145 | //0123456789123456 |
145 | //0123456789123456 |
146 | {0,0},// "No Error \0", // 0 |
146 | {0,0},// "No Error \0", // 0 |
147 | {SPEAK_ERROR,0}, // "Not compatible \0", // 1 |
147 | {SPEAK_ERROR,0}, // "Not compatible \0", // 1 |
148 | {SPEAK_ERROR,0}, // "MK3Mag not compa\0", // 2 |
148 | {SPEAK_ERROR,0}, // "MK3Mag not compa\0", // 2 |
149 | {SPEAK_ERR_NAVI,1}, // "No FC communicat\0", // 3 |
149 | {SPEAK_ERR_NAVI,1}, // "No FC communicat\0", // 3 |
150 | {SPEAK_ERR_COMPASS,1}, // "MK3Mag communica\0", // 4 |
150 | {SPEAK_ERR_COMPASS,1}, // "MK3Mag communica\0", // 4 |
151 | {SPEAK_ERR_GPS,0}, // "GPS communicatio\0", // 5 |
151 | {SPEAK_ERR_GPS,0}, // "GPS communicatio\0", // 5 |
152 | {SPEAK_ERR_COMPASS,1}, // "compass value \0", // 6 |
152 | {SPEAK_ERR_COMPASS,1}, // "compass value \0", // 6 |
153 | {SPEAK_ERR_RECEICER,0},// "RC Signal lost \0", // 7 |
153 | {SPEAK_ERR_RECEICER,0},// "RC Signal lost \0", // 7 |
154 | {SPEAK_ERR_NAVI,0}, // "FC spi rx error \0", // 8 |
154 | {SPEAK_ERR_NAVI,0}, // "FC spi rx error \0", // 8 |
155 | {SPEAK_ERR_NAVI,0}, // "No NC communicat\0", // 9 |
155 | {SPEAK_ERR_NAVI,0}, // "No NC communicat\0", // 9 |
156 | {SPEAK_ERR_SENSOR,0}, // "FC Nick Gyro \0", // 10 |
156 | {SPEAK_ERR_SENSOR,0}, // "FC Nick Gyro \0", // 10 |
157 | {SPEAK_ERR_SENSOR,0}, // "FC Roll Gyro \0", // 11 |
157 | {SPEAK_ERR_SENSOR,0}, // "FC Roll Gyro \0", // 11 |
158 | {SPEAK_ERR_SENSOR,0}, // "FC Yaw Gyro \0", // 12 |
158 | {SPEAK_ERR_SENSOR,0}, // "FC Yaw Gyro \0", // 12 |
159 | {SPEAK_ERR_SENSOR,0}, // "FC Nick ACC \0", // 13 |
159 | {SPEAK_ERR_SENSOR,0}, // "FC Nick ACC \0", // 13 |
160 | {SPEAK_ERR_SENSOR,0}, // "FC Roll ACC \0", // 14 |
160 | {SPEAK_ERR_SENSOR,0}, // "FC Roll ACC \0", // 14 |
161 | {SPEAK_ERR_SENSOR,0}, // "FC Z-ACC \0", // 15 |
161 | {SPEAK_ERR_SENSOR,0}, // "FC Z-ACC \0", // 15 |
162 | {SPEAK_ERR_SENSOR,0}, // "Pressure sensor \0", // 16 |
162 | {SPEAK_ERR_SENSOR,0}, // "Pressure sensor \0", // 16 |
163 | {SPEAK_ERR_DATABUS,1}, // "I2C FC->BL-Ctrl \0", // 17 |
163 | {SPEAK_ERR_DATABUS,1}, // "I2C FC->BL-Ctrl \0", // 17 |
164 | {SPEAK_ERR_DATABUS,1}, // "Bl Missing \0", // 18 |
164 | {SPEAK_ERR_DATABUS,1}, // "Bl Missing \0", // 18 |
165 | {SPEAK_ERROR,0}, // "Mixer Error \0", // 19 |
165 | {SPEAK_ERROR,0}, // "Mixer Error \0", // 19 |
166 | {SPEAK_CF_OFF,1}, // "Carefree Error \0", // 20 |
166 | {SPEAK_CF_OFF,1}, // "Carefree Error \0", // 20 |
167 | {SPEAK_GPS_FIX,1}, // "GPS Fix lost \0", // 21 |
167 | {SPEAK_GPS_FIX,1}, // "GPS Fix lost \0", // 21 |
168 | {SPEAK_ERR_COMPASS,0}, // "Magnet Error \0", // 22 |
168 | {SPEAK_ERR_COMPASS,0}, // "Magnet Error \0", // 22 |
169 | {SPEAK_ERR_MOTOR,1}, // "Motor restart \0", // 23 |
169 | {SPEAK_ERR_MOTOR,1}, // "Motor restart \0", // 23 |
170 | {SPEAK_MAX_TEMPERAT,1},// "BL Limitation \0", // 24 |
170 | {SPEAK_MAX_TEMPERAT,1},// "BL Limitation \0", // 24 |
171 | {SPEAK_MAX_RANGE,1}, // "GPS Range \0", // 25 |
171 | {SPEAK_MAX_RANGE,1}, // "GPS Range \0", // 25 |
172 | {SPEAK_ERROR,1}, // "No SD-Card \0", // 26 |
172 | {SPEAK_ERROR,1}, // "No SD-Card \0", // 26 |
173 | {SPEAK_ERROR,1}, // "SD-Logging error\0", // 27 |
173 | {SPEAK_ERROR,1}, // "SD-Logging error\0", // 27 |
174 | {SPEAK_MAX_RANGE,1}, // "Flying range! \0", // 28 |
174 | {SPEAK_MAX_RANGE,1}, // "Flying range! \0", // 28 |
175 | {SPEAK_MAX_ALTITUD,1}, // "Max Altitude! \0" // 29 |
175 | {SPEAK_MAX_ALTITUD,1}, // "Max Altitude! \0" // 29 |
176 | {SPEAK_GPS_FIX,1}, // "No GPS fix \0" // 30 |
176 | {SPEAK_GPS_FIX,1}, // "No GPS fix \0" // 30 |
177 | {SPEAK_ERR_CALIBARTION,0},// "compass not cal." // 31 |
177 | {SPEAK_ERR_CALIBARTION,0},// "compass not cal." // 31 |
178 | {SPEAK_ERR_MOTOR,0}, // "BL-Selftest \0" // 32 |
178 | {SPEAK_ERR_MOTOR,0}, // "BL-Selftest \0" // 32 |
179 | {SPEAK_ERR_COMPASS,0}, // "no ext. compass" // 33 |
179 | {SPEAK_ERR_COMPASS,0}, // "no ext. compass" // 33 |
180 | {SPEAK_ERR_COMPASS,0} // "compass sensor" // 34 |
180 | {SPEAK_ERR_COMPASS,0} // "compass sensor" // 34 |
181 | }; |
181 | }; |
182 | 182 | ||
183 | 183 | ||
184 | void GetHottestBl(void) |
184 | void GetHottestBl(void) |
185 | { |
185 | { |
186 | static unsigned char search = 0,tmp_max,tmp_min,who; |
186 | static unsigned char search = 0,tmp_max,tmp_min,who; |
187 | if(Motor[search].Temperature > tmp_max) { tmp_max = Motor[search].Temperature; who = search;} |
187 | if(Motor[search].Temperature > tmp_max) { tmp_max = Motor[search].Temperature; who = search;} |
188 | else |
188 | else |
189 | if(Motor[search].Temperature) if(Motor[search].Temperature < tmp_min) tmp_min = Motor[search].Temperature; |
189 | if(Motor[search].Temperature) if(Motor[search].Temperature < tmp_min) tmp_min = Motor[search].Temperature; |
190 | if(++search >= MAX_MOTORS) |
190 | if(++search >= MAX_MOTORS) |
191 | { |
191 | { |
192 | search = 0; |
192 | search = 0; |
193 | if(tmp_min != 255) MinBlTemperture = tmp_min; else MinBlTemperture = 0; |
193 | if(tmp_min != 255) MinBlTemperture = tmp_min; else MinBlTemperture = 0; |
194 | MaxBlTemperture = tmp_max; |
194 | MaxBlTemperture = tmp_max; |
195 | HottestBl = who; |
195 | HottestBl = who; |
196 | tmp_min = 255; |
196 | tmp_min = 255; |
197 | tmp_max = 0; |
197 | tmp_max = 0; |
198 | who = 0; |
198 | who = 0; |
199 | } |
199 | } |
200 | } |
200 | } |
201 | 201 | ||
202 | //--------------------------------------------------------------- |
202 | //--------------------------------------------------------------- |
203 | void Hott_ClearLine(unsigned char line) |
203 | void Hott_ClearLine(unsigned char line) |
204 | { |
204 | { |
205 | HoTT_printfxy(0,line," "); |
205 | HoTT_printfxy(0,line," "); |
206 | } |
206 | } |
207 | //--------------------------------------------------------------- |
207 | //--------------------------------------------------------------- |
208 | 208 | ||
209 | 209 | ||
210 | unsigned char HoTT_Waring(void) |
210 | unsigned char HoTT_Waring(void) |
211 | { |
211 | { |
212 | unsigned char status = 0; |
212 | unsigned char status = 0; |
213 | static char old_status = 0; |
213 | static char old_status = 0; |
214 | static int repeat; |
214 | static int repeat; |
215 | //if(Parameter_UserParam1) return(Parameter_UserParam1); |
215 | //if(Parameter_UserParam1) return(Parameter_UserParam1); |
216 | ToNC_SpeakHoTT = SpeakHoTT; |
216 | ToNC_SpeakHoTT = SpeakHoTT; |
217 | if(FC_StatusFlags & FC_STATUS_LOWBAT) |
217 | if(FC_StatusFlags & FC_STATUS_LOWBAT) |
218 | { |
218 | { |
219 | if(LowVoltageLandingActive && (EE_Parameter.Receiver == RECEIVER_HOTT)) status = SPEAK_LANDING; |
219 | if(LowVoltageLandingActive && (EE_Parameter.Receiver == RECEIVER_HOTT)) status = SPEAK_LANDING; |
220 | else status = VOICE_MINIMALE_EINGANSSPANNUNG; // Jeti hat kein wort: "LANDEN" |
220 | else status = VOICE_MINIMALE_EINGANSSPANNUNG; // Jeti hat kein wort: "LANDEN" |
221 | if(SpeakHoTT && old_status == VOICE_MINIMALE_EINGANSSPANNUNG) status = SpeakHoTT; // das soll auch noch durch kommen |
221 | if(SpeakHoTT && old_status == VOICE_MINIMALE_EINGANSSPANNUNG) status = SpeakHoTT; // das soll auch noch durch kommen |
222 | } |
222 | } |
223 | else |
223 | else |
224 | if(NC_ErrorCode && NC_ErrorCode < MAX_ERR_NUMBER) // Fehlercodes |
224 | if(NC_ErrorCode && NC_ErrorCode < MAX_ERR_NUMBER) // Fehlercodes |
225 | { |
225 | { |
226 | if(MotorenEin || !pgm_read_byte(&HOTT_ERROR[NC_ErrorCode][1])) status = pgm_read_byte(&HOTT_ERROR[NC_ErrorCode][0]); |
226 | if(MotorenEin || !pgm_read_byte(&HOTT_ERROR[NC_ErrorCode][1])) status = pgm_read_byte(&HOTT_ERROR[NC_ErrorCode][0]); |
227 | } |
227 | } |
228 | if(!status) // Sprachansagen |
228 | if(!status) // Sprachansagen |
229 | { |
229 | { |
230 | // if(!(GetParamByte(PID_SPEAK_HOTT_CFG) & 0x01)) SpeakHoTT = 0; // is the voice wanted? |
230 | // if(!(GetParamByte(PID_SPEAK_HOTT_CFG) & 0x01)) SpeakHoTT = 0; // is the voice wanted? |
231 | if(!(EE_Parameter.GlobalConfig3 & CFG3_SPEAK_ALL)) SpeakHoTT = 0; // is the voice wanted? |
231 | if(!(EE_Parameter.GlobalConfig3 & CFG3_SPEAK_ALL)) SpeakHoTT = 0; // is the voice wanted? |
232 | else status = SpeakHoTT; |
232 | else status = SpeakHoTT; |
233 | } |
233 | } |
234 | else ToNC_SpeakHoTT = status; |
234 | else ToNC_SpeakHoTT = status; |
235 | 235 | ||
236 | if(old_status == status) // Gleichen Fehler nur alle 4 sek bringen |
236 | if(old_status == status) // Gleichen Fehler nur alle 4 sek bringen |
237 | { |
237 | { |
238 | if(!CheckDelay(repeat)) return(0); |
238 | if(!CheckDelay(repeat)) return(0); |
239 | repeat = SetDelay(4000); |
239 | repeat = SetDelay(4000); |
240 | } |
240 | } |
241 | else repeat = SetDelay(2000); |
241 | else repeat = SetDelay(2000); |
242 | 242 | ||
243 | if(status) |
243 | if(status) |
244 | { |
244 | { |
245 | if(status == SpeakHoTT) SpeakHoTT = 0; |
245 | if(status == SpeakHoTT) SpeakHoTT = 0; |
246 | } |
246 | } |
247 | old_status = status; |
247 | old_status = status; |
248 | // DebugOut.Analog[16] = status; |
248 | // DebugOut.Analog[16] = status; |
249 | return(status); |
249 | return(status); |
250 | } |
250 | } |
251 | 251 | ||
252 | /* |
252 | /* |
253 | unsigned char HoTTErrorCode(void) |
253 | unsigned char HoTTErrorCode(void) |
254 | { |
254 | { |
255 | return(NC_ErrorCode); |
255 | return(NC_ErrorCode); |
256 | } |
256 | } |
257 | */ |
257 | */ |
258 | //--------------------------------------------------------------- |
258 | //--------------------------------------------------------------- |
259 | void NC_Fills_HoTT_Telemety(void) |
259 | void NC_Fills_HoTT_Telemety(void) |
260 | { |
260 | { |
261 | unsigned char *ptr = NULL; |
261 | unsigned char *ptr = NULL; |
262 | unsigned char max = 0,i,z; |
262 | unsigned char max = 0,i,z; |
263 | switch(FromNaviCtrl.Param.Byte[11]) |
263 | switch(FromNaviCtrl.Param.Byte[11]) |
264 | { |
264 | { |
265 | case HOTT_VARIO_PACKET_ID: |
265 | case HOTT_VARIO_PACKET_ID: |
266 | ptr = (unsigned char *) &VarioPacket; |
266 | ptr = (unsigned char *) &VarioPacket; |
267 | max = sizeof(VarioPacket); |
267 | max = sizeof(VarioPacket); |
268 | break; |
268 | break; |
269 | case HOTT_GPS_PACKET_ID: |
269 | case HOTT_GPS_PACKET_ID: |
270 | ptr = (unsigned char *) &GPSPacket; |
270 | ptr = (unsigned char *) &GPSPacket; |
271 | max = sizeof(GPSPacket); |
271 | max = sizeof(GPSPacket); |
272 | break; |
272 | break; |
273 | case HOTT_ELECTRIC_AIR_PACKET_ID: |
273 | case HOTT_ELECTRIC_AIR_PACKET_ID: |
274 | ptr = (unsigned char *) &ElectricAirPacket; |
274 | ptr = (unsigned char *) &ElectricAirPacket; |
275 | max = sizeof(ElectricAirPacket); |
275 | max = sizeof(ElectricAirPacket); |
276 | break; |
276 | break; |
277 | case HOTT_GENERAL_PACKET_ID: |
277 | case HOTT_GENERAL_PACKET_ID: |
278 | ptr = (unsigned char *) &HoTTGeneral; |
278 | ptr = (unsigned char *) &HoTTGeneral; |
279 | max = sizeof(HoTTGeneral); |
279 | max = sizeof(HoTTGeneral); |
280 | break; |
280 | break; |
281 | case JETI_GPS_PACKET_ID1: |
281 | case JETI_GPS_PACKET_ID1: |
282 | ptr = (unsigned char *) &JetiExData[14].Value; |
282 | ptr = (unsigned char *) &JetiExData[14].Value; |
283 | max = sizeof(JetiExData[14].Value); |
283 | max = sizeof(JetiExData[14].Value); |
284 | break; |
284 | break; |
285 | case JETI_GPS_PACKET_ID2: |
285 | case JETI_GPS_PACKET_ID2: |
286 | ptr = (unsigned char *) &JetiExData[15].Value; |
286 | ptr = (unsigned char *) &JetiExData[15].Value; |
287 | max = sizeof(JetiExData[15].Value); |
287 | max = sizeof(JetiExData[15].Value); |
288 | break; |
288 | break; |
289 | } |
289 | } |
290 | z = FromNaviCtrl.Param.Byte[0]; // Data allocation |
290 | z = FromNaviCtrl.Param.Byte[0]; // Data allocation |
291 | 291 | ||
292 | for(i=0; i < FromNaviCtrl.Param.Byte[1]; i++) |
292 | for(i=0; i < FromNaviCtrl.Param.Byte[1]; i++) |
293 | { |
293 | { |
294 | if(z >= max) break; |
294 | if(z >= max) break; |
295 | ptr[z] = FromNaviCtrl.Param.Byte[2+i]; |
295 | ptr[z] = FromNaviCtrl.Param.Byte[2+i]; |
296 | z++; |
296 | z++; |
297 | } |
297 | } |
298 | } |
298 | } |
299 | 299 | ||
300 | unsigned int BuildHoTT_Vario(void) |
300 | unsigned int BuildHoTT_Vario(void) |
301 | { |
301 | { |
302 | unsigned int tmp = VARIO_ZERO; |
302 | unsigned int tmp = VARIO_ZERO; |
303 | if(VarioCharacter == '+' || VarioCharacter == '-') |
303 | if(VarioCharacter == '+' || VarioCharacter == '-') |
304 | { |
304 | { |
305 | tmp = VARIO_ZERO + (AltitudeSetpointTrimming * EE_Parameter.Hoehe_Verstaerkung) / 3; |
305 | tmp = VARIO_ZERO + (AltitudeSetpointTrimming * EE_Parameter.Hoehe_Verstaerkung) / 3; |
306 | if(tmp < VARIO_ZERO && tmp > VARIO_ZERO - 50) tmp = VARIO_ZERO - 50; // weil es sonst erst bei < 0,5m/sek piept |
306 | if(tmp < VARIO_ZERO && tmp > VARIO_ZERO - 50) tmp = VARIO_ZERO - 50; // weil es sonst erst bei < 0,5m/sek piept |
307 | } |
307 | } |
308 | else |
308 | else |
309 | if((VarioCharacter == ' ') && (FC_StatusFlags & FC_STATUS_FLY)) |
309 | if((VarioCharacter == ' ') && (FC_StatusFlags & FC_STATUS_FLY)) |
310 | { |
310 | { |
311 | tmp = VARIO_ZERO + HoTTVarioMeter; |
311 | tmp = VARIO_ZERO + HoTTVarioMeter; |
312 | if(tmp > VARIO_ZERO) |
312 | if(tmp > VARIO_ZERO) |
313 | { |
313 | { |
314 | if(tmp < VARIO_ZERO + 100) tmp = VARIO_ZERO; |
314 | if(tmp < VARIO_ZERO + 100) tmp = VARIO_ZERO; |
315 | else tmp -= 100; |
315 | else tmp -= 100; |
316 | } |
316 | } |
317 | if(tmp < VARIO_ZERO) |
317 | if(tmp < VARIO_ZERO) |
318 | { |
318 | { |
319 | if(tmp > VARIO_ZERO - 100) tmp = VARIO_ZERO; |
319 | if(tmp > VARIO_ZERO - 100) tmp = VARIO_ZERO; |
320 | else tmp += 100; |
320 | else tmp += 100; |
321 | } |
321 | } |
322 | } |
322 | } |
323 | else |
323 | else |
324 | if(VarioCharacter == '^') tmp = VARIO_ZERO + FromNC_AltitudeSpeed * 10; |
324 | if(VarioCharacter == '^') tmp = VARIO_ZERO + FromNC_AltitudeSpeed * 10; |
325 | else |
325 | else |
326 | if(VarioCharacter == 'v') tmp = VARIO_ZERO - FromNC_AltitudeSpeed * 10; |
326 | if(VarioCharacter == 'v') tmp = VARIO_ZERO - FromNC_AltitudeSpeed * 10; |
327 | return(tmp); |
327 | return(tmp); |
328 | } |
328 | } |
329 | 329 | ||
330 | //--------------------------------------------------------------- |
330 | //--------------------------------------------------------------- |
331 | unsigned char HoTT_Telemety(unsigned char packet_request) |
331 | unsigned char HoTT_Telemety(unsigned char packet_request) |
332 | { |
332 | { |
333 | unsigned char i; |
333 | unsigned char i; |
334 | //Debug("rqst: %02X",packet_request); |
334 | //Debug("rqst: %02X",packet_request); |
335 | switch(packet_request) |
335 | switch(packet_request) |
336 | { |
336 | { |
337 | case HOTT_VARIO_PACKET_ID: |
337 | case HOTT_VARIO_PACKET_ID: |
338 | GPSPacket.WarnBeep = HoTT_Waring(); // Achtung: das ist richtig hier, damit der Varioton schon vorher abgestellt wird |
338 | GPSPacket.WarnBeep = HoTT_Waring(); // Achtung: das ist richtig hier, damit der Varioton schon vorher abgestellt wird |
339 | VarioPacket.Altitude = HoehenWert/100 + 500; |
339 | VarioPacket.Altitude = HoehenWert/100 + 500; |
340 | if(!GPSPacket.WarnBeep) VarioPacket.m_sec = BuildHoTT_Vario(); else VarioPacket.m_sec = VARIO_ZERO; |
340 | if(!GPSPacket.WarnBeep) VarioPacket.m_sec = BuildHoTT_Vario(); else VarioPacket.m_sec = VARIO_ZERO; |
341 | VarioPacket.m_3sec = VarioPacket.m_sec; |
341 | VarioPacket.m_3sec = VarioPacket.m_sec; |
342 | VarioPacket.m_10sec = VarioPacket.m_sec; |
342 | VarioPacket.m_10sec = VarioPacket.m_sec; |
343 | if (VarioPacket.Altitude < VarioPacket.MinAltitude) VarioPacket.MinAltitude = VarioPacket.Altitude; |
343 | if (VarioPacket.Altitude < VarioPacket.MinAltitude) VarioPacket.MinAltitude = VarioPacket.Altitude; |
344 | if (VarioPacket.Altitude > VarioPacket.MaxAltitude) VarioPacket.MaxAltitude = VarioPacket.Altitude; |
344 | if (VarioPacket.Altitude > VarioPacket.MaxAltitude) VarioPacket.MaxAltitude = VarioPacket.Altitude; |
345 | VarioPacket.WarnBeep = 0;//HoTT_Waring(); |
345 | VarioPacket.WarnBeep = 0;//HoTT_Waring(); |
346 | HoTT_DataPointer = (unsigned char *) &VarioPacket; |
346 | HoTT_DataPointer = (unsigned char *) &VarioPacket; |
347 | VarioPacket.FreeCharacters[0] = VarioCharacter; |
347 | VarioPacket.FreeCharacters[0] = VarioCharacter; |
348 | if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) VarioPacket.FreeCharacters[1] = 'C'; else VarioPacket.FreeCharacters[1] = ' '; |
348 | if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) VarioPacket.FreeCharacters[1] = 'C'; else VarioPacket.FreeCharacters[1] = ' '; |
349 | // VarioPacket.FreeCharacters[2] = ' '; |
349 | // VarioPacket.FreeCharacters[2] = ' '; |
350 | if(NC_ErrorCode) |
350 | if(NC_ErrorCode) |
351 | { |
351 | { |
352 | VarioPacket.Text[0] = NC_ErrorCode/10 + '0'; |
352 | VarioPacket.Text[0] = NC_ErrorCode/10 + '0'; |
353 | VarioPacket.Text[1] = NC_ErrorCode%10 + '0'; |
353 | VarioPacket.Text[1] = NC_ErrorCode%10 + '0'; |
354 | VarioPacket.Text[2] = ':'; |
354 | VarioPacket.Text[2] = ':'; |
355 | for(i=0; i<16;i++) VarioPacket.Text[i+3] = pgm_read_byte(&NC_ERROR_TEXT[NC_ErrorCode][i]); |
355 | for(i=0; i<16;i++) VarioPacket.Text[i+3] = pgm_read_byte(&NC_ERROR_TEXT[NC_ErrorCode][i]); |
356 | VarioPacket.Text[19] = ' '; |
356 | VarioPacket.Text[19] = ' '; |
357 | VarioPacket.Text[20] = ' '; |
357 | VarioPacket.Text[20] = ' '; |
358 | } |
358 | } |
359 | else |
359 | else |
360 | if(LowVoltageLandingActive) for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&LANDING[i]); // no Error |
360 | if(LowVoltageLandingActive) for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&LANDING[i]); // no Error |
361 | else |
361 | else |
362 | if(FC_StatusFlags & FC_STATUS_LOWBAT) for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&UNDERVOLTAGE[i]); // no Error |
362 | if(FC_StatusFlags & FC_STATUS_LOWBAT) for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&UNDERVOLTAGE[i]); // no Error |
363 | else |
363 | else |
364 | if(ShowSettingNameTime) // no Error |
364 | if(ShowSettingNameTime) // no Error |
365 | { |
365 | { |
366 | for(i=0; i<sizeof(SETTING);i++) VarioPacket.Text[i] = pgm_read_byte(&SETTING[i]); |
366 | for(i=0; i<sizeof(SETTING);i++) VarioPacket.Text[i] = pgm_read_byte(&SETTING[i]); |
367 | VarioPacket.Text[4] = '0' + ActiveParamSet; |
367 | VarioPacket.Text[4] = '0' + ActiveParamSet; |
368 | for(i=0; i<sizeof(EE_Parameter.Name);i++) VarioPacket.Text[i+7] = EE_Parameter.Name[i]; // no Error |
368 | for(i=0; i<sizeof(EE_Parameter.Name);i++) VarioPacket.Text[i+7] = EE_Parameter.Name[i]; // no Error |
369 | VarioPacket.Text[18] = ' '; |
369 | VarioPacket.Text[18] = ' '; |
370 | VarioPacket.Text[19] = ' '; |
370 | VarioPacket.Text[19] = ' '; |
371 | VarioPacket.Text[20] = ' '; |
371 | VarioPacket.Text[20] = ' '; |
372 | } |
372 | } |
373 | else |
373 | else |
374 | if(NaviData_WaypointNumber) |
374 | if(NaviData_WaypointNumber) |
375 | { |
375 | { |
376 | unsigned int tmp_int; |
376 | unsigned int tmp_int; |
377 | unsigned char tmp; |
377 | unsigned char tmp; |
378 | VarioPacket.Text[0] = 'W'; VarioPacket.Text[1] = 'P'; |
378 | VarioPacket.Text[0] = 'W'; VarioPacket.Text[1] = 'P'; |
379 | VarioPacket.Text[2] = ' '; |
379 | VarioPacket.Text[2] = ' '; |
380 | VarioPacket.Text[3] = '0'+(NaviData_WaypointIndex) / 10; |
380 | VarioPacket.Text[3] = '0'+(NaviData_WaypointIndex) / 10; |
381 | VarioPacket.Text[4] = '0'+(NaviData_WaypointIndex) % 10; |
381 | VarioPacket.Text[4] = '0'+(NaviData_WaypointIndex) % 10; |
382 | VarioPacket.Text[5] = '/'; |
382 | VarioPacket.Text[5] = '/'; |
383 | VarioPacket.Text[6] = '0'+(NaviData_WaypointNumber) / 10; |
383 | VarioPacket.Text[6] = '0'+(NaviData_WaypointNumber) / 10; |
384 | VarioPacket.Text[7] = '0'+(NaviData_WaypointNumber) % 10; |
384 | VarioPacket.Text[7] = '0'+(NaviData_WaypointNumber) % 10; |
385 | VarioPacket.Text[8] = ' '; |
385 | VarioPacket.Text[8] = ' '; |
386 | tmp_int = NaviData_TargetDistance; |
386 | tmp_int = NaviData_TargetDistance; |
387 | if(tmp_int > 1000) { VarioPacket.Text[9] = '0'+(tmp_int) / 1000; tmp_int %= 1000;} |
387 | if(tmp_int > 1000) { VarioPacket.Text[9] = '0'+(tmp_int) / 1000; tmp_int %= 1000;} |
388 | else VarioPacket.Text[9] = ' '; |
388 | else VarioPacket.Text[9] = ' '; |
389 | if(tmp_int > 100) { VarioPacket.Text[10] = '0'+(tmp_int) / 100; tmp_int %= 100;} |
389 | if(tmp_int > 100) { VarioPacket.Text[10] = '0'+(tmp_int) / 100; tmp_int %= 100;} |
390 | else VarioPacket.Text[10] = ' '; |
390 | else VarioPacket.Text[10] = ' '; |
391 | VarioPacket.Text[11] = '0'+(tmp_int) / 10; |
391 | VarioPacket.Text[11] = '0'+(tmp_int) / 10; |
392 | VarioPacket.Text[12] = '0'+(tmp_int) % 10; |
392 | VarioPacket.Text[12] = '0'+(tmp_int) % 10; |
393 | VarioPacket.Text[13] = 'm'; |
393 | VarioPacket.Text[13] = 'm'; |
394 | VarioPacket.Text[14] = ' '; |
394 | VarioPacket.Text[14] = ' '; |
395 | tmp = NaviData_TargetHoldTime; |
395 | tmp = NaviData_TargetHoldTime; |
396 | if(tmp > 100) { VarioPacket.Text[15] = '0'+(tmp) / 100; tmp %= 100;} else VarioPacket.Text[15] = ' '; |
396 | if(tmp > 100) { VarioPacket.Text[15] = '0'+(tmp) / 100; tmp %= 100;} else VarioPacket.Text[15] = ' '; |
397 | VarioPacket.Text[16] = '0'+(tmp) / 10; |
397 | VarioPacket.Text[16] = '0'+(tmp) / 10; |
398 | VarioPacket.Text[17] = '0'+(tmp) % 10; |
398 | VarioPacket.Text[17] = '0'+(tmp) % 10; |
399 | VarioPacket.Text[18] = 's'; |
399 | VarioPacket.Text[18] = 's'; |
400 | VarioPacket.Text[19] = ' '; |
400 | VarioPacket.Text[19] = ' '; |
401 | VarioPacket.Text[20] = ' '; |
401 | VarioPacket.Text[20] = ' '; |
402 | } |
402 | } |
403 | else |
403 | else |
404 | if(!CalibrationDone) |
404 | if(!CalibrationDone) |
405 | { |
405 | { |
406 | for(i=0; i<17;i++) VarioPacket.Text[i] = pgm_read_byte(&MIKROKOPTER[i+2]); // no Error and not calibrated |
406 | for(i=0; i<17;i++) VarioPacket.Text[i] = pgm_read_byte(&MIKROKOPTER[i+2]); // no Error and not calibrated |
407 | VarioPacket.Text[16] = '0'+VERSION_MAJOR; |
407 | VarioPacket.Text[16] = '0'+VERSION_MAJOR; |
408 | VarioPacket.Text[17] = '.'; |
408 | VarioPacket.Text[17] = '.'; |
409 | VarioPacket.Text[18] = '0'+VERSION_MINOR/10; |
409 | VarioPacket.Text[18] = '0'+VERSION_MINOR/10; |
410 | VarioPacket.Text[19] = '0'+VERSION_MINOR%10; |
410 | VarioPacket.Text[19] = '0'+VERSION_MINOR%10; |
411 | VarioPacket.Text[20] = 'a'+VERSION_PATCH; |
411 | VarioPacket.Text[20] = 'a'+VERSION_PATCH; |
412 | } |
412 | } |
413 | else |
413 | else |
414 | { |
414 | { |
415 | for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&MIKROKOPTER[i]); // no Error |
415 | for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&MIKROKOPTER[i]); // no Error |
- | 416 | if(RedundanceBlOperation) VarioPacket.Text[0] = 'R'; |
|
416 | } |
417 | } |
417 | return(sizeof(VarioPacket)); |
418 | return(sizeof(VarioPacket)); |
418 | break; |
419 | break; |
419 | 420 | ||
420 | case HOTT_GPS_PACKET_ID: |
421 | case HOTT_GPS_PACKET_ID: |
421 | GPSPacket.Altitude = HoehenWert/100 + 500; |
422 | GPSPacket.Altitude = HoehenWert/100 + 500; |
422 | // GPSPacket.Distance = GPSInfo.HomeDistance/10; // macht die NC |
423 | // GPSPacket.Distance = GPSInfo.HomeDistance/10; // macht die NC |
423 | // GPSPacket.Heading = GPSInfo.HomeBearing/2; // macht die NC |
424 | // GPSPacket.Heading = GPSInfo.HomeBearing/2; // macht die NC |
424 | // GPSPacket.Speed = (GPSInfo.Speed * 36) / 10; // macht die NC |
425 | // GPSPacket.Speed = (GPSInfo.Speed * 36) / 10; // macht die NC |
425 | // GPSPacket.WarnBeep = HoTT_Waring(); //(wird jetzt weiter oben gemacht) |
426 | // GPSPacket.WarnBeep = HoTT_Waring(); //(wird jetzt weiter oben gemacht) |
426 | if(!GPSPacket.WarnBeep) GPSPacket.m_sec = BuildHoTT_Vario(); else GPSPacket.m_sec = VARIO_ZERO; |
427 | if(!GPSPacket.WarnBeep) GPSPacket.m_sec = BuildHoTT_Vario(); else GPSPacket.m_sec = VARIO_ZERO; |
427 | GPSPacket.m_3sec = 120; |
428 | GPSPacket.m_3sec = 120; |
428 | GPSPacket.NumOfSats = GPSInfo.NumOfSats; |
429 | GPSPacket.NumOfSats = GPSInfo.NumOfSats; |
429 | if(GPSInfo.Flags & FLAG_DIFFSOLN) GPSPacket.SatFix = 'D'; |
430 | if(GPSInfo.Flags & FLAG_DIFFSOLN) GPSPacket.SatFix = 'D'; |
430 | else |
431 | else |
431 | if(GPSInfo.SatFix == SATFIX_3D) GPSPacket.SatFix = ' '; |
432 | if(GPSInfo.SatFix == SATFIX_3D) GPSPacket.SatFix = ' '; |
432 | else GPSPacket.SatFix = '!'; |
433 | else GPSPacket.SatFix = '!'; |
433 | HoTT_DataPointer = (unsigned char *) &GPSPacket; |
434 | HoTT_DataPointer = (unsigned char *) &GPSPacket; |
434 | GPSPacket.FreeCharacters[0] = NC_GPS_ModeCharacter; |
435 | GPSPacket.FreeCharacters[0] = NC_GPS_ModeCharacter; |
435 | GPSPacket.FreeCharacters[2] = GPSPacket.SatFix; |
436 | GPSPacket.FreeCharacters[2] = GPSPacket.SatFix; |
436 | GPSPacket.HomeDirection = GPSInfo.HomeBearing / 2;//230; |
437 | GPSPacket.HomeDirection = GPSInfo.HomeBearing / 2;//230; |
437 | return(sizeof(GPSPacket)); |
438 | return(sizeof(GPSPacket)); |
438 | break; |
439 | break; |
439 | case HOTT_ELECTRIC_AIR_PACKET_ID: |
440 | case HOTT_ELECTRIC_AIR_PACKET_ID: |
440 | GetHottestBl(); |
441 | GetHottestBl(); |
441 | ElectricAirPacket.Altitude = HoehenWert/100 + 500; |
442 | ElectricAirPacket.Altitude = HoehenWert/100 + 500; |
442 | ElectricAirPacket.Battery1 = UBat; |
443 | ElectricAirPacket.Battery1 = UBat; |
443 | ElectricAirPacket.Battery2 = UBat; |
444 | ElectricAirPacket.Battery2 = UBat; |
444 | ElectricAirPacket.VoltageCell1 = ErsatzKompassInGrad / 2; |
445 | ElectricAirPacket.VoltageCell1 = ErsatzKompassInGrad / 2; |
445 | ElectricAirPacket.VoltageCell8 = ElectricAirPacket.VoltageCell1; |
446 | ElectricAirPacket.VoltageCell8 = ElectricAirPacket.VoltageCell1; |
446 | ElectricAirPacket.VoltageCell6 = GPSInfo.HomeBearing / 2; |
447 | ElectricAirPacket.VoltageCell6 = GPSInfo.HomeBearing / 2; |
447 | ElectricAirPacket.VoltageCell7 = GPSInfo.HomeDistance/20; |
448 | ElectricAirPacket.VoltageCell7 = GPSInfo.HomeDistance/20; |
448 | ElectricAirPacket.VoltageCell13 = ElectricAirPacket.VoltageCell6; |
449 | ElectricAirPacket.VoltageCell13 = ElectricAirPacket.VoltageCell6; |
449 | ElectricAirPacket.VoltageCell14 = ElectricAirPacket.VoltageCell7; |
450 | ElectricAirPacket.VoltageCell14 = ElectricAirPacket.VoltageCell7; |
450 | if(!GPSPacket.WarnBeep) ElectricAirPacket.m_sec = BuildHoTT_Vario(); else ElectricAirPacket.m_sec = VARIO_ZERO; |
451 | if(!GPSPacket.WarnBeep) ElectricAirPacket.m_sec = BuildHoTT_Vario(); else ElectricAirPacket.m_sec = VARIO_ZERO; |
451 | ElectricAirPacket.m_3sec = 120; |
452 | ElectricAirPacket.m_3sec = 120; |
452 | ElectricAirPacket.InputVoltage = UBat; |
453 | ElectricAirPacket.InputVoltage = UBat; |
453 | ElectricAirPacket.Temperature1 = MinBlTemperture + 20; |
454 | ElectricAirPacket.Temperature1 = MinBlTemperture + 20; |
454 | ElectricAirPacket.Temperature2 = MaxBlTemperture + 20; |
455 | ElectricAirPacket.Temperature2 = MaxBlTemperture + 20; |
455 | ElectricAirPacket.Capacity = Capacity.UsedCapacity/10; |
456 | ElectricAirPacket.Capacity = Capacity.UsedCapacity/10; |
456 | // ElectricAirPacket.WarnBeep = 0;//HoTT_Waring(); |
457 | // ElectricAirPacket.WarnBeep = 0;//HoTT_Waring(); |
457 | ElectricAirPacket.WarnBeep = GPSPacket.WarnBeep; |
458 | ElectricAirPacket.WarnBeep = GPSPacket.WarnBeep; |
458 | ElectricAirPacket.Current = Capacity.ActualCurrent; |
459 | ElectricAirPacket.Current = Capacity.ActualCurrent; |
459 | HoTT_DataPointer = (unsigned char *) &ElectricAirPacket; |
460 | HoTT_DataPointer = (unsigned char *) &ElectricAirPacket; |
460 | ElectricAirPacket.FlightTimeMinutes = FlugSekunden / 60; |
461 | ElectricAirPacket.FlightTimeMinutes = FlugSekunden / 60; |
461 | ElectricAirPacket.FlightTimeSeconds = FlugSekunden % 60; |
462 | ElectricAirPacket.FlightTimeSeconds = FlugSekunden % 60; |
462 | return(sizeof(ElectricAirPacket)); |
463 | return(sizeof(ElectricAirPacket)); |
463 | break; |
464 | break; |
464 | case HOTT_GENERAL_PACKET_ID: |
465 | case HOTT_GENERAL_PACKET_ID: |
465 | GetHottestBl(); |
466 | GetHottestBl(); |
466 | HoTTGeneral.Rpm = GPSInfo.HomeDistance/100; |
467 | HoTTGeneral.Rpm = GPSInfo.HomeDistance/100; |
467 | HoTTGeneral.VoltageCell1 = ErsatzKompassInGrad / 2; |
468 | HoTTGeneral.VoltageCell1 = ErsatzKompassInGrad / 2; |
468 | HoTTGeneral.VoltageCell2 = KompassValue / 2; |
469 | HoTTGeneral.VoltageCell2 = KompassValue / 2; |
469 | //HoTTGeneral.VoltageCell3 = Magnetstaerke -> macht NC |
470 | //HoTTGeneral.VoltageCell3 = Magnetstaerke -> macht NC |
470 | //HoTTGeneral.VoltageCell4 = Inclinition -> macht NC |
471 | //HoTTGeneral.VoltageCell4 = Inclinition -> macht NC |
471 | HoTTGeneral.VoltageCell5 = DebugOut.Analog[28]; // I2C ErrorCounter |
472 | HoTTGeneral.VoltageCell5 = DebugOut.Analog[28]; // I2C ErrorCounter |
472 | HoTTGeneral.VoltageCell6 = GPSInfo.HomeBearing / 2; |
473 | HoTTGeneral.VoltageCell6 = GPSInfo.HomeBearing / 2; |
473 | if(UBat > BattLowVoltageWarning + 2) HoTTGeneral.FuelPercent = (UBat - (BattLowVoltageWarning + 2)) * 3; |
474 | if(UBat > BattLowVoltageWarning + 2) HoTTGeneral.FuelPercent = (UBat - (BattLowVoltageWarning + 2)) * 3; |
474 | else HoTTGeneral.FuelPercent = 0; |
475 | else HoTTGeneral.FuelPercent = 0; |
475 | if(HoTTGeneral.FuelPercent > 100) HoTTGeneral.FuelPercent = 100; |
476 | if(HoTTGeneral.FuelPercent > 100) HoTTGeneral.FuelPercent = 100; |
476 | HoTTGeneral.FuelCapacity = NC_ErrorCode;//HoehenWert/100; // Oelpegel |
477 | HoTTGeneral.FuelCapacity = NC_ErrorCode;//HoehenWert/100; // Oelpegel |
477 | // if(HoTTGeneral.FuelCapacity < 0) HoTTGeneral.FuelCapacity = 0; |
478 | // if(HoTTGeneral.FuelCapacity < 0) HoTTGeneral.FuelCapacity = 0; |
478 | HoTTGeneral.Altitude = HoehenWert/100 + 500; |
479 | HoTTGeneral.Altitude = HoehenWert/100 + 500; |
479 | HoTTGeneral.Battery1 = UBat; |
480 | HoTTGeneral.Battery1 = UBat; |
480 | HoTTGeneral.Battery2 = UBat; |
481 | HoTTGeneral.Battery2 = UBat; |
481 | if(!GPSPacket.WarnBeep) HoTTGeneral.m_sec = BuildHoTT_Vario(); else HoTTGeneral.m_sec = VARIO_ZERO; |
482 | if(!GPSPacket.WarnBeep) HoTTGeneral.m_sec = BuildHoTT_Vario(); else HoTTGeneral.m_sec = VARIO_ZERO; |
482 | HoTTGeneral.m_3sec = 120 + GPSPacket.WarnBeep; |
483 | HoTTGeneral.m_3sec = 120 + GPSPacket.WarnBeep; |
483 | HoTTGeneral.InputVoltage = UBat; |
484 | HoTTGeneral.InputVoltage = UBat; |
484 | HoTTGeneral.Temperature1 = MinBlTemperture + 20; |
485 | HoTTGeneral.Temperature1 = MinBlTemperture + 20; |
485 | HoTTGeneral.Temperature2 = MaxBlTemperture + 20; |
486 | HoTTGeneral.Temperature2 = MaxBlTemperture + 20; |
486 | HoTTGeneral.Capacity = Capacity.UsedCapacity/10; |
487 | HoTTGeneral.Capacity = Capacity.UsedCapacity/10; |
487 | HoTTGeneral.WarnBeep = 0;//HoTT_Waring(); |
488 | HoTTGeneral.WarnBeep = 0;//HoTT_Waring(); |
488 | HoTTGeneral.Current = Capacity.ActualCurrent; |
489 | HoTTGeneral.Current = Capacity.ActualCurrent; |
489 | //HoTTGeneral.ErrorNumber = HoTTErrorCode(); |
490 | //HoTTGeneral.ErrorNumber = HoTTErrorCode(); |
490 | HoTT_DataPointer = (unsigned char *) &HoTTGeneral; |
491 | HoTT_DataPointer = (unsigned char *) &HoTTGeneral; |
491 | return(sizeof(HoTTGeneral)); |
492 | return(sizeof(HoTTGeneral)); |
492 | break; |
493 | break; |
493 | default: return(0); |
494 | default: return(0); |
494 | } |
495 | } |
495 | } |
496 | } |
496 | 497 | ||
497 | //--------------------------------------------------------------- |
498 | //--------------------------------------------------------------- |
498 | void HoTT_Menu(void) |
499 | void HoTT_Menu(void) |
499 | { |
500 | { |
500 | static unsigned char line, page = 0,show_current = 0,show_mag = 0, show_poti = 0; |
501 | static unsigned char line, page = 0,show_current = 0,show_mag = 0, show_poti = 0, load_waypoint_tmp, changed, load_waypoint_tmp2, changed2; |
501 | unsigned char tmp; |
502 | unsigned char tmp; |
502 | HoTTVarioMeter = (HoTTVarioMeter * 7 + VarioMeter) / 8; |
503 | HoTTVarioMeter = (HoTTVarioMeter * 7 + VarioMeter) / 8; |
503 | 504 | ||
504 | if(page == 0) |
505 | if(page == 0) |
505 | switch(line++) |
506 | switch(line++) |
506 | { |
507 | { |
507 | case 0: |
508 | case 0: |
508 | if(FC_StatusFlags & FC_STATUS_LOWBAT) |
509 | if(FC_StatusFlags & FC_STATUS_LOWBAT) |
509 | HoTT_printfxy_BLINK(0,0," %2i.%1iV ",UBat/10, UBat%10) |
510 | HoTT_printfxy_BLINK(0,0," %2i.%1iV ",UBat/10, UBat%10) |
510 | else |
511 | else |
511 | HoTT_printfxy(0,0," %2i.%1iV ",UBat/10, UBat%10) |
512 | HoTT_printfxy(0,0," %2i.%1iV ",UBat/10, UBat%10) |
512 | 513 | ||
513 | if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG) |
514 | if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG) |
514 | { |
515 | { |
515 | if(HoehenReglerAktiv) HoTT_printfxy_INV(10,0,"ALT:%4im %c", (int16_t)(HoehenWert/100),VarioCharacter) |
516 | if(HoehenReglerAktiv) HoTT_printfxy_INV(10,0,"ALT:%4im %c", (int16_t)(HoehenWert/100),VarioCharacter) |
516 | else HoTT_printfxy(10,0,"ALT:%4im ", (int16_t)(HoehenWert/100)) |
517 | else HoTT_printfxy(10,0,"ALT:%4im ", (int16_t)(HoehenWert/100)) |
517 | } |
518 | } |
518 | else HoTT_printfxy(10,0,"ALT:---- "); |
519 | else HoTT_printfxy(10,0,"ALT:---- "); |
519 | break; |
520 | break; |
520 | case 1: |
521 | case 1: |
521 | if(FC_StatusFlags & FC_STATUS_LOWBAT) |
522 | if(FC_StatusFlags & FC_STATUS_LOWBAT) |
522 | HoTT_printfxy_BLINK(0,1," %2i:%02i ",FlugSekunden/60,FlugSekunden%60) |
523 | HoTT_printfxy_BLINK(0,1," %2i:%02i ",FlugSekunden/60,FlugSekunden%60) |
523 | else HoTT_printfxy(0,1," %2i:%02i ",FlugSekunden/60,FlugSekunden%60); |
524 | else HoTT_printfxy(0,1," %2i:%02i ",FlugSekunden/60,FlugSekunden%60); |
524 | HoTT_printfxy(10,1,"DIR: %3d%c",ErsatzKompassInGrad, HoTT_GRAD); |
525 | HoTT_printfxy(10,1,"DIR: %3d%c",ErsatzKompassInGrad, HoTT_GRAD); |
525 | if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) HoTT_printfxy_INV(20,1,"C") else HoTT_printfxy(20,1," "); |
526 | if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) HoTT_printfxy_INV(20,1,"C") else HoTT_printfxy(20,1," "); |
526 | break; |
527 | break; |
527 | case 2: |
528 | case 2: |
528 | if(FC_StatusFlags & FC_STATUS_LOWBAT) |
529 | if(FC_StatusFlags & FC_STATUS_LOWBAT) |
529 | HoTT_printfxy_BLINK(0,2," %5i ",Capacity.UsedCapacity) |
530 | HoTT_printfxy_BLINK(0,2," %5i ",Capacity.UsedCapacity) |
530 | else HoTT_printfxy(0,2," %5i ",Capacity.UsedCapacity); |
531 | else HoTT_printfxy(0,2," %5i ",Capacity.UsedCapacity); |
531 | HoTT_printfxy(12,2,"I:%2i.%1iA ",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10); |
532 | HoTT_printfxy(12,2,"I:%2i.%1iA ",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10); |
532 | break; |
533 | break; |
533 | case 3: |
534 | case 3: |
534 | HoTT_printfxy(9,0,":"); |
535 | HoTT_printfxy(9,0,":"); |
535 | HoTT_printfxy(9,1,":"); |
536 | HoTT_printfxy(9,1,":"); |
536 | HoTT_printfxy(9,2,":"); |
537 | HoTT_printfxy(9,2,":"); |
537 | HoTT_printfxy(0,3,"---------+-----------"); |
538 | HoTT_printfxy(0,3,"---------+-----------"); |
538 | 539 | ||
539 | // HoTT_printfxy(0,3,"---------------------"); |
540 | // HoTT_printfxy(0,3,"---------------------"); |
540 | HoTT_printfxy(0,6,"---------------------"); |
541 | HoTT_printfxy(0,6,"---------------------"); |
541 | break; |
542 | break; |
542 | case 4: |
543 | case 4: |
543 | if(NaviDataOkay) |
544 | if(NaviDataOkay) |
544 | { |
545 | { |
545 | HoTT_printfxy(9,4,":"); |
546 | HoTT_printfxy(9,4,":"); |
546 | HoTT_printfxy(0,4,"SAT:%2d ",GPSInfo.NumOfSats); |
547 | HoTT_printfxy(0,4,"SAT:%2d ",GPSInfo.NumOfSats); |
547 | HoTT_printfxy(10,4,"DIST:%3dm",GPSInfo.HomeDistance/10); |
548 | HoTT_printfxy(10,4,"DIST:%3dm",GPSInfo.HomeDistance/10); |
548 | switch (GPSInfo.SatFix) |
549 | switch (GPSInfo.SatFix) |
549 | { |
550 | { |
550 | case SATFIX_3D: |
551 | case SATFIX_3D: |
551 | if(GPSInfo.Flags & FLAG_DIFFSOLN) HoTT_printfxy(7,4,"D ") |
552 | if(GPSInfo.Flags & FLAG_DIFFSOLN) HoTT_printfxy(7,4,"D ") |
552 | else HoTT_printfxy(7,4,"3D"); |
553 | else HoTT_printfxy(7,4,"3D"); |
553 | break; |
554 | break; |
554 | default: |
555 | default: |
555 | HoTT_printfxy_BLINK(7,4,"!!"); |
556 | HoTT_printfxy_BLINK(7,4,"!!"); |
556 | break; |
557 | break; |
557 | } |
558 | } |
558 | } |
559 | } |
559 | else |
560 | else |
560 | { |
561 | { |
561 | Hott_ClearLine(4); |
562 | Hott_ClearLine(4); |
562 | } |
563 | } |
563 | break; |
564 | break; |
564 | case 5: |
565 | case 5: |
565 | if(NaviDataOkay) |
566 | if(NaviDataOkay) |
566 | { |
567 | { |
567 | if(show_mag) |
568 | if(show_mag) |
568 | { |
569 | { |
569 | HoTT_printfxy(0,5,"MAG:%3u%% ",EarthMagneticField); |
570 | HoTT_printfxy(0,5,"MAG:%3u%% ",EarthMagneticField); |
570 | HoTT_printfxy(12,5,"HM:%3d%c %c", GPSInfo.HomeBearing, HoTT_GRAD, NC_GPS_ModeCharacter); |
571 | HoTT_printfxy(12,5,"HM:%3d%c %c", GPSInfo.HomeBearing, HoTT_GRAD, NC_GPS_ModeCharacter); |
571 | HoTT_printfxy(9,5,"incl:%2d%c(%2i)",EarthMagneticInclination, HoTT_GRAD,EarthMagneticInclinationTheoretic); |
572 | HoTT_printfxy(9,5,"incl:%2d%c(%2i)",EarthMagneticInclination, HoTT_GRAD,EarthMagneticInclinationTheoretic); |
572 | } |
573 | } |
573 | else |
574 | else |
574 | { |
575 | { |
575 | HoTT_printfxy(0,5," %2um/s: HM:%3d%c %c",GPSInfo.Speed, GPSInfo.HomeBearing, HoTT_GRAD, NC_GPS_ModeCharacter); |
576 | HoTT_printfxy(0,5," %2um/s: HM:%3d%c %c",GPSInfo.Speed, GPSInfo.HomeBearing, HoTT_GRAD, NC_GPS_ModeCharacter); |
576 | } |
577 | } |
577 | } |
578 | } |
578 | else Hott_ClearLine(5); |
579 | else Hott_ClearLine(5); |
579 | break; |
580 | break; |
580 | case 6: |
581 | case 6: |
581 | break; |
582 | break; |
582 | case 7: if(NC_ErrorCode) |
583 | case 7: if(NC_ErrorCode) |
583 | { |
584 | { |
584 | if(HoTTBlink && NC_ErrorCode < MAX_ERR_NUMBER) |
585 | if(HoTTBlink && NC_ErrorCode < MAX_ERR_NUMBER) |
585 | { |
586 | { |
586 | Hott_ClearLine(7); |
587 | Hott_ClearLine(7); |
587 | HoTT_printfxy_INV(0,7,"ERR: %2d !",NC_ErrorCode); |
588 | HoTT_printfxy_INV(0,7,"ERR: %2d !",NC_ErrorCode); |
588 | } |
589 | } |
589 | else |
590 | else |
590 | { |
591 | { |
591 | HoTT_printfxy(0,7,"ERR: "); _printf_P(&LIBFC_HoTT_Putchar, NC_ERROR_TEXT[NC_ErrorCode] , 0);}; |
592 | HoTT_printfxy(0,7,"ERR: "); _printf_P(&LIBFC_HoTT_Putchar, NC_ERROR_TEXT[NC_ErrorCode] , 0);}; |
592 | } |
593 | } |
593 | else |
594 | else |
594 | if(FC_StatusFlags & FC_STATUS_LOWBAT) HoTT_printfxy(1,7,"!! LiPo voltage !!") |
595 | if(FC_StatusFlags & FC_STATUS_LOWBAT) HoTT_printfxy(1,7,"!! LiPo voltage !!") |
595 | else HoTT_printfxy(0,7," www.MikroKopter.de "); |
596 | else HoTT_printfxy(0,7," www.MikroKopter.de "); |
596 | break; |
597 | break; |
597 | case 8: //ASCIIPacket.WarnBeep = HoTT_Waring(); |
598 | case 8: //ASCIIPacket.WarnBeep = HoTT_Waring(); |
598 | // ASCIIPacket.WarnBeep = Parameter_UserParam1; |
599 | // ASCIIPacket.WarnBeep = Parameter_UserParam1; |
599 | case 9: |
600 | case 9: |
600 | case 10: |
601 | case 10: |
601 | case 11: |
602 | case 11: |
602 | case 12: |
603 | case 12: |
603 | case 13: |
604 | case 13: |
604 | case 14: |
605 | case 14: |
605 | case 15: |
606 | case 15: |
606 | case 16: |
607 | case 16: |
607 | if(HottKeyboard == HOTT_KEY_SET) { if(show_mag) show_mag = 0; else show_mag = 1;} |
608 | if(HottKeyboard == HOTT_KEY_SET) { if(show_mag) show_mag = 0; else show_mag = 1;} |
608 | else |
609 | else |
609 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page = 1; line = 0;}; |
610 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page = 1; line = 0;}; |
610 | HottKeyboard = 0; |
611 | HottKeyboard = 0; |
611 | break; |
612 | break; |
612 | default: line = 0; |
613 | default: line = 0; |
613 | break; |
614 | break; |
614 | } |
615 | } |
615 | else |
616 | else |
616 | if(page == 1) |
617 | if(page == 1) |
617 | switch(line++) |
618 | switch(line++) |
618 | { |
619 | { |
619 | case 0: |
620 | case 0: |
620 | if(FC_StatusFlags & FC_STATUS_LOWBAT) |
621 | if(FC_StatusFlags & FC_STATUS_LOWBAT) |
621 | HoTT_printfxy_BLINK(0,0," %2i:%02i %2i.%1iV %4imAh",FlugSekunden/60,FlugSekunden%60,UBat/10, UBat%10,Capacity.UsedCapacity) |
622 | HoTT_printfxy_BLINK(0,0," %2i:%02i %2i.%1iV %4imAh",FlugSekunden/60,FlugSekunden%60,UBat/10, UBat%10,Capacity.UsedCapacity) |
622 | else HoTT_printfxy(0,0," %2i:%02i %2i.%1iV %4imAh",FlugSekunden/60,FlugSekunden%60,UBat/10, UBat%10,Capacity.UsedCapacity); |
623 | else HoTT_printfxy(0,0," %2i:%02i %2i.%1iV %4imAh",FlugSekunden/60,FlugSekunden%60,UBat/10, UBat%10,Capacity.UsedCapacity); |
623 | break; |
624 | break; |
624 | case 1: |
625 | case 1: |
625 | HoTT_printfxy(0,1,"DIR:%3d%c",KompassValue, HoTT_GRAD); |
626 | HoTT_printfxy(0,1,"DIR:%3d%c",KompassValue, HoTT_GRAD); |
626 | if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG) |
627 | if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG) |
627 | { |
628 | { |
628 | if(HoehenReglerAktiv) HoTT_printfxy_INV(10,1,"ALT:%4im", (int16_t)(HoehenWert/100)) |
629 | if(HoehenReglerAktiv) HoTT_printfxy_INV(10,1,"ALT:%4im", (int16_t)(HoehenWert/100)) |
629 | else HoTT_printfxy(10,1,"ALT:%4im", (int16_t)(HoehenWert/100)) |
630 | else HoTT_printfxy(10,1,"ALT:%4im", (int16_t)(HoehenWert/100)) |
630 | } |
631 | } |
631 | else HoTT_printfxy(10,1,"ALT:---- "); |
632 | else HoTT_printfxy(10,1,"ALT:---- "); |
632 | HoTT_printfxy(20,1,"%c",VarioCharacter); |
633 | HoTT_printfxy(20,1,"%c",VarioCharacter); |
633 | break; |
634 | break; |
634 | case 2: |
635 | case 2: |
635 | if(NaviDataOkay) |
636 | if(NaviDataOkay) |
636 | { |
637 | { |
637 | HoTT_printfxy(1,2,"HM:%3d%c DIST:%3dm %c", GPSInfo.HomeBearing, HoTT_GRAD, GPSInfo.HomeDistance/10, NC_GPS_ModeCharacter); |
638 | HoTT_printfxy(1,2,"HM:%3d%c DIST:%3dm %c", GPSInfo.HomeBearing, HoTT_GRAD, GPSInfo.HomeDistance/10, NC_GPS_ModeCharacter); |
638 | } |
639 | } |
639 | else |
640 | else |
640 | { |
641 | { |
641 | Hott_ClearLine(2); |
642 | Hott_ClearLine(2); |
642 | } |
643 | } |
643 | break; |
644 | break; |
644 | case 3: |
645 | case 3: |
645 | HoTT_printfxy(0,3,"PWR:%2i.%1iA (%iW) ",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10,Capacity.ActualPower); |
646 | HoTT_printfxy(0,3,"PWR:%2i.%1iA (%iW) ",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10,Capacity.ActualPower); |
646 | if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) HoTT_printfxy_INV(19,3,"CF") else HoTT_printfxy(19,3," "); |
647 | if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) HoTT_printfxy_INV(19,3,"CF") else HoTT_printfxy(19,3," "); |
647 | break; |
648 | break; |
648 | case 4: |
649 | case 4: |
649 | if(NaviDataOkay) |
650 | if(NaviDataOkay) |
650 | { |
651 | { |
651 | HoTT_printfxy(0,4,"GPS:%2um/s SAT:%d ",GPSInfo.Speed,GPSInfo.NumOfSats); |
652 | HoTT_printfxy(0,4,"GPS:%2um/s SAT:%d ",GPSInfo.Speed,GPSInfo.NumOfSats); |
652 | switch (GPSInfo.SatFix) |
653 | switch (GPSInfo.SatFix) |
653 | { |
654 | { |
654 | case SATFIX_3D: |
655 | case SATFIX_3D: |
655 | HoTT_printfxy(16,4," 3D "); |
656 | HoTT_printfxy(16,4," 3D "); |
656 | break; |
657 | break; |
657 | //case SATFIX_2D: |
658 | //case SATFIX_2D: |
658 | //case SATFIX_NONE: |
659 | //case SATFIX_NONE: |
659 | default: |
660 | default: |
660 | HoTT_printfxy_BLINK(16,4,"NOFIX"); |
661 | HoTT_printfxy_BLINK(16,4,"NOFIX"); |
661 | break; |
662 | break; |
662 | } |
663 | } |
663 | if(GPSInfo.Flags & FLAG_DIFFSOLN) |
664 | if(GPSInfo.Flags & FLAG_DIFFSOLN) |
664 | { |
665 | { |
665 | HoTT_printfxy(16,4,"DGPS "); |
666 | HoTT_printfxy(16,4,"DGPS "); |
666 | } |
667 | } |
667 | } |
668 | } |
668 | else |
669 | else |
669 | { //012345678901234567890 |
670 | { //012345678901234567890 |
670 | HoTT_printfxy(0,4," No NaviCtrl "); |
671 | HoTT_printfxy(0,4," No NaviCtrl "); |
671 | } |
672 | } |
672 | break; |
673 | break; |
673 | case 5: |
674 | case 5: |
674 | if(show_current) |
675 | if(show_current) |
675 | { |
676 | { |
676 | // 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); |
677 | // 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); |
677 | 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); |
678 | 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); |
678 | } |
679 | } |
679 | else |
680 | else |
680 | { |
681 | { |
681 | HoTT_printfxy(0,5,"%3i %3i %3i %3i%cC", Motor[0].Temperature, Motor[1].Temperature, Motor[2].Temperature, Motor[3].Temperature,HoTT_GRAD); |
682 | HoTT_printfxy(0,5,"%3i %3i %3i %3i%cC", Motor[0].Temperature, Motor[1].Temperature, Motor[2].Temperature, Motor[3].Temperature,HoTT_GRAD); |
682 | } |
683 | } |
683 | break; |
684 | break; |
684 | case 6: |
685 | case 6: |
685 | if(show_current) |
686 | if(show_current) |
686 | { |
687 | { |
687 | if(RequiredMotors == 4) Hott_ClearLine(6); |
688 | if(RequiredMotors == 4) Hott_ClearLine(6); |
688 | else |
689 | else |
689 | // 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) |
690 | // 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) |
690 | 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) |
691 | 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) |
691 | else |
692 | else |
692 | // 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); |
693 | // 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); |
693 | 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); |
694 | 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); |
694 | } |
695 | } |
695 | else |
696 | else |
696 | { |
697 | { |
697 | if(RequiredMotors == 4) Hott_ClearLine(6); |
698 | if(RequiredMotors == 4) Hott_ClearLine(6); |
698 | else |
699 | else |
699 | if(RequiredMotors == 6) HoTT_printfxy(0,6,"%3i %3i%cC ", Motor[4].Temperature, Motor[5].Temperature,HoTT_GRAD) |
700 | if(RequiredMotors == 6) HoTT_printfxy(0,6,"%3i %3i%cC ", Motor[4].Temperature, Motor[5].Temperature,HoTT_GRAD) |
700 | else |
701 | else |
701 | 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); |
702 | 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); |
702 | } |
703 | } |
703 | break; |
704 | break; |
704 | case 7: if(NC_ErrorCode) |
705 | case 7: if(NC_ErrorCode) |
705 | { |
706 | { |
706 | if(HoTTBlink && NC_ErrorCode < MAX_ERR_NUMBER) |
707 | if(HoTTBlink && NC_ErrorCode < MAX_ERR_NUMBER) |
707 | { |
708 | { |
708 | Hott_ClearLine(7); |
709 | Hott_ClearLine(7); |
709 | HoTT_printfxy_INV(0,7,"ERR: %2d !",NC_ErrorCode); |
710 | HoTT_printfxy_INV(0,7,"ERR: %2d !",NC_ErrorCode); |
710 | } |
711 | } |
711 | else |
712 | else |
712 | { |
713 | { |
713 | HoTT_printfxy(0,7,"ERR: "); _printf_P(&LIBFC_HoTT_Putchar, NC_ERROR_TEXT[NC_ErrorCode] , 0);}; |
714 | HoTT_printfxy(0,7,"ERR: "); _printf_P(&LIBFC_HoTT_Putchar, NC_ERROR_TEXT[NC_ErrorCode] , 0);}; |
714 | } |
715 | } |
715 | else |
716 | else |
716 | if(FC_StatusFlags & FC_STATUS_LOWBAT) HoTT_printfxy(1,7,"!! LiPo voltage !!") |
717 | if(FC_StatusFlags & FC_STATUS_LOWBAT) HoTT_printfxy(1,7,"!! LiPo voltage !!") |
717 | else HoTT_printfxy(0,7," www.MikroKopter.de "); |
718 | else HoTT_printfxy(0,7," www.MikroKopter.de "); |
718 | break; |
719 | break; |
719 | case 8: // ASCIIPacket.WarnBeep = HoTT_Waring(); |
720 | case 8: // ASCIIPacket.WarnBeep = HoTT_Waring(); |
720 | // ASCIIPacket.WarnBeep = Parameter_UserParam1; |
721 | // ASCIIPacket.WarnBeep = Parameter_UserParam1; |
721 | case 9: |
722 | case 9: |
722 | case 10: |
723 | case 10: |
723 | case 11: |
724 | case 11: |
724 | case 12: |
725 | case 12: |
725 | case 13: |
726 | case 13: |
726 | case 14: |
727 | case 14: |
727 | case 15: |
728 | case 15: |
728 | case 16: |
729 | case 16: |
729 | if(HottKeyboard == HOTT_KEY_SET) { if(show_current) show_current = 0; else show_current = 1; Hott_ClearLine(5); Hott_ClearLine(6);} |
730 | if(HottKeyboard == HOTT_KEY_SET) { if(show_current) show_current = 0; else show_current = 1; Hott_ClearLine(5); Hott_ClearLine(6);} |
730 | else |
731 | else |
731 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page = 2; line = 0;} |
732 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page = 2; line = 0;} |
732 | else |
733 | else |
733 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page = 0; line = 0;} |
734 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page = 0; line = 0;} |
734 | //if(HottKeyboard) HoTT_printfxy(15,6,"%KEY:%02x ",HottKeyboard); |
735 | //if(HottKeyboard) HoTT_printfxy(15,6,"%KEY:%02x ",HottKeyboard); |
735 | HottKeyboard = 0; |
736 | HottKeyboard = 0; |
736 | break; |
737 | break; |
737 | default: line = 0; |
738 | default: line = 0; |
738 | break; |
739 | break; |
739 | } |
740 | } |
740 | else |
741 | else |
741 | if(page == 2) |
742 | if(page == 2) |
742 | switch(line++) |
743 | switch(line++) |
743 | { |
744 | { |
744 | case 0: |
745 | case 0: |
745 | HoTT_printfxy_INV(0,0,"Setting:%u %s ",ActiveParamSet,EE_Parameter.Name); |
746 | HoTT_printfxy_INV(0,0,"Setting:%u %s ",ActiveParamSet,EE_Parameter.Name); |
746 | break; |
747 | break; |
747 | case 1: HoTT_printfxy(0,1,"Min:%2i.%1iV %s ",BattLowVoltageWarning/10, BattLowVoltageWarning%10, Mixer.Name); |
748 | case 1: HoTT_printfxy(0,1,"Min:%2i.%1iV %s ",BattLowVoltageWarning/10, BattLowVoltageWarning%10, Mixer.Name); |
748 | break; |
749 | break; |
749 | case 2: HoTT_printfxy(0,2,"ALT:"); |
750 | case 2: HoTT_printfxy(0,2,"ALT:"); |
750 | if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG) |
751 | if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG) |
751 | { |
752 | { |
752 | if(!(EE_Parameter.GlobalConfig & CFG_HOEHEN_SCHALTER)) HoTT_printf("POTI:%3u ", Parameter_HoehenSchalter) |
753 | if(!(EE_Parameter.GlobalConfig & CFG_HOEHEN_SCHALTER)) HoTT_printf("POTI:%3u ", Parameter_HoehenSchalter) |
753 | else |
754 | else |
754 | { |
755 | { |
755 | if(Parameter_HoehenSchalter > 50) HoTT_printf("(ON) ") else HoTT_printf("(OFF) "); |
756 | if(Parameter_HoehenSchalter > 50) HoTT_printf("(ON) ") else HoTT_printf("(OFF) "); |
756 | if((Parameter_ExtraConfig & CFG2_HEIGHT_LIMIT)) HoTT_printf("LIMIT", Parameter_HoehenSchalter) |
757 | if((Parameter_ExtraConfig & CFG2_HEIGHT_LIMIT)) HoTT_printf("LIMIT", Parameter_HoehenSchalter) |
757 | else HoTT_printf("VARIO", Parameter_HoehenSchalter); |
758 | else HoTT_printf("VARIO", Parameter_HoehenSchalter); |
758 | } |
759 | } |
759 | } |
760 | } |
760 | else |
761 | else |
761 | HoTT_printf("DISABLED"); |
762 | HoTT_printf("DISABLED"); |
762 | break; |
763 | break; |
763 | case 3: HoTT_printfxy(0,3,"CF:"); |
764 | case 3: HoTT_printfxy(0,3,"CF:"); |
764 | if(!EE_Parameter.CareFreeChannel) HoTT_printf("DISABLED") |
765 | if(!EE_Parameter.CareFreeChannel) HoTT_printf("DISABLED") |
765 | else |
766 | else |
766 | { |
767 | { |
767 | if(CareFree) HoTT_printf(" (ON) ") else HoTT_printf(" (OFF)"); |
768 | if(CareFree) HoTT_printf(" (ON) ") else HoTT_printf(" (OFF)"); |
768 | if(EE_Parameter.ExtraConfig & CFG_LEARNABLE_CAREFREE) HoTT_printf(" TEACH"); |
769 | if(EE_Parameter.ExtraConfig & CFG_LEARNABLE_CAREFREE) HoTT_printf(" TEACH"); |
769 | } |
770 | } |
770 | break; |
771 | break; |
771 | case 4: HoTT_printfxy(0,4,"GPS:"); |
772 | case 4: HoTT_printfxy(0,4,"GPS:"); |
772 | if(!(Parameter_GlobalConfig & CFG_GPS_AKTIV)) HoTT_printf("DISABLED") |
773 | if(!(Parameter_GlobalConfig & CFG_GPS_AKTIV)) HoTT_printf("DISABLED") |
773 | else |
774 | else |
774 | { |
775 | { |
775 | tmp = GetChannelValue(EE_Parameter.NaviGpsModeChannel); |
776 | tmp = GetChannelValue(EE_Parameter.NaviGpsModeChannel); |
776 | if(tmp < 50) HoTT_printf("(FREE)") |
777 | if(tmp < 50) HoTT_printf("(FREE)") |
777 | else |
778 | else |
778 | if(tmp >= 180) HoTT_printf("(HOME)") |
779 | if(tmp >= 180) HoTT_printf("(HOME)") |
779 | else |
780 | else |
780 | if(EE_Parameter.ExtraConfig & CFG_GPS_AID) HoTT_printf("(AID) ") |
781 | if(EE_Parameter.ExtraConfig & CFG_GPS_AID) HoTT_printf("(AID) ") |
781 | else HoTT_printf("(HOLD)") |
782 | else HoTT_printf("(HOLD)") |
782 | } |
783 | } |
783 | if(EE_Parameter.FailSafeTime) HoTT_printfxy(10,4," FS:%usek ",EE_Parameter.FailSafeTime) |
784 | if(EE_Parameter.FailSafeTime) HoTT_printfxy(10,4," FS:%usek ",EE_Parameter.FailSafeTime) |
784 | 785 | ||
785 | break; |
786 | break; |
786 | case 5: HoTT_printfxy(0,5,"HOME ALT:"); |
787 | case 5: HoTT_printfxy(0,5,"HOME ALT:"); |
787 | if(EE_Parameter.ComingHomeAltitude) HoTT_printf("%um",EE_Parameter.ComingHomeAltitude) else HoTT_printf("HOLD "); |
788 | if(EE_Parameter.ComingHomeAltitude) HoTT_printf("%um",EE_Parameter.ComingHomeAltitude) else HoTT_printf("HOLD "); |
788 | break; |
789 | break; |
789 | case 6: |
790 | case 6: |
790 | if(!show_poti) |
791 | if(!show_poti) |
791 | { |
792 | { |
792 | HoTT_printfxy(0,6,"Ni:%4i Ro:%4i C:%3i",PPM_in[EE_Parameter.Kanalbelegung[K_NICK]],PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]], Parameter_ServoNickControl); |
793 | HoTT_printfxy(0,6,"Ni:%4i Ro:%4i C:%3i",PPM_in[EE_Parameter.Kanalbelegung[K_NICK]],PPM_in[EE_Parameter.Kanalbelegung[K_ROLL]], Parameter_ServoNickControl); |
793 | HoTT_printfxy(0,7,"Gs:%4i Ya:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_GAS]]+127,PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]); |
794 | HoTT_printfxy(0,7,"Gs:%4i Ya:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_GAS]]+127,PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]); |
794 | } |
795 | } |
795 | else |
796 | else |
796 | { |
797 | { |
797 | HoTT_printfxy(0,6,"P1:%4i P2:%4i 3:%3i",Poti1,Poti2, Poti3); |
798 | HoTT_printfxy(0,6,"P1:%4i P2:%4i 3:%3i",Poti1,Poti2, Poti3); |
798 | HoTT_printfxy(0,7,"P4:%4i P5:%4i 6:%3i",Poti4,Poti5, Poti6); |
799 | HoTT_printfxy(0,7,"P4:%4i P5:%4i 6:%3i",Poti4,Poti5, Poti6); |
799 | } |
800 | } |
800 | 801 | ||
801 | break; |
802 | break; |
802 | case 7: //HoTT_printfxy(0,6,"WARNINGS:"); |
803 | case 7: //HoTT_printfxy(0,6,"WARNINGS:"); |
803 | if(HoTTBlink) |
804 | if(HoTTBlink) |
804 | { |
805 | { |
805 | LIBFC_HoTT_SetPos(6 * 21); |
806 | LIBFC_HoTT_SetPos(6 * 21); |
806 | if(!(Parameter_GlobalConfig & CFG_ACHSENKOPPLUNG_AKTIV)) HoTT_printf_BLINK("COUPLING OFF! "); |
807 | if(!(Parameter_GlobalConfig & CFG_ACHSENKOPPLUNG_AKTIV)) HoTT_printf_BLINK("COUPLING OFF! "); |
807 | if(EE_Parameter.BitConfig & (CFG_LOOP_LINKS | CFG_LOOP_RECHTS | CFG_LOOP_UNTEN | CFG_LOOP_OBEN)) HoTT_printf_BLINK("LOOPING! "); |
808 | if(EE_Parameter.BitConfig & (CFG_LOOP_LINKS | CFG_LOOP_RECHTS | CFG_LOOP_UNTEN | CFG_LOOP_OBEN)) HoTT_printf_BLINK("LOOPING! "); |
808 | if(Parameter_GlobalConfig & CFG_HEADING_HOLD) HoTT_printf_BLINK("HH! "); |
809 | if(Parameter_GlobalConfig & CFG_HEADING_HOLD) HoTT_printf_BLINK("HH! "); |
809 | if(!(Parameter_GlobalConfig & CFG_KOMPASS_AKTIV)) HoTT_printf_BLINK("COMPASS OFF! "); |
810 | if(!(Parameter_GlobalConfig & CFG_KOMPASS_AKTIV)) HoTT_printf_BLINK("COMPASS OFF! "); |
810 | } |
811 | } |
811 | break; |
812 | break; |
812 | case 8: //ASCIIPacket.WarnBeep = HoTT_Waring(); |
813 | case 8: //ASCIIPacket.WarnBeep = HoTT_Waring(); |
813 | break; |
814 | break; |
814 | case 9: |
815 | case 9: |
815 | case 10: |
816 | case 10: |
816 | case 11: |
817 | case 11: |
817 | case 12: |
818 | case 12: |
818 | case 13: |
819 | case 13: |
819 | case 14: |
820 | case 14: |
820 | case 15: |
821 | case 15: |
821 | case 16: |
822 | case 16: |
822 | if(HottKeyboard == HOTT_KEY_SET) { if(show_poti) show_poti = 0; else show_poti = 1; Hott_ClearLine(6); Hott_ClearLine(7);} |
823 | if(HottKeyboard == HOTT_KEY_SET) { if(show_poti) show_poti = 0; else show_poti = 1; Hott_ClearLine(6); Hott_ClearLine(7);} |
823 | // else |
824 | else |
824 | // if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page = 3; line = 0;} |
825 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page = 3; line = 0;} |
825 | else |
826 | else |
826 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page = 1; line = 0;}; |
827 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page = 1; line = 0;}; |
827 | HottKeyboard = 0; |
828 | HottKeyboard = 0; |
828 | break; |
829 | break; |
829 | default: line = 0; |
830 | default: line = 0; |
830 | break; |
831 | break; |
831 | } |
832 | } |
- | 833 | else |
|
- | 834 | if(page == 3) |
|
- | 835 | switch(line++) |
|
- | 836 | { |
|
- | 837 | case 0: |
|
- | 838 | HoTT_printfxy(0,0,"Load Waypoints"); |
|
- | 839 | break; |
|
- | 840 | case 1: //HoTT_printfxy(0,1,"Min:%2i.%1iV %s ",BattLowVoltageWarning/10, BattLowVoltageWarning%10, Mixer.Name); |
|
- | 841 | HoTT_printfxy(0,1,"(Absolute)"); |
|
- | 842 | break; |
|
- | 843 | case 2: |
|
- | 844 | if(load_waypoint_tmp) |
|
- | 845 | { |
|
- | 846 | HoTT_printfxy(0,3,"Load list: ") |
|
- | 847 | if(changed && HoTTBlink) HoTT_printfxy(10,3," ", load_waypoint_tmp) |
|
- | 848 | else HoTT_printfxy(10,3,"%2d ", load_waypoint_tmp); |
|
- | 849 | } |
|
- | 850 | else |
|
- | 851 | { |
|
- | 852 | HoTT_printfxy(0,3,"Load list: -- "); |
|
- | 853 | } |
|
- | 854 | break; |
|
- | 855 | case 3: |
|
- | 856 | if(changed && load_waypoint_tmp) HoTT_printfxy(0,4,"(Set -> Load)") |
|
- | 857 | else HoTT_printfxy(0,4," "); |
|
- | 858 | break; |
|
- | 859 | case 4: |
|
- | 860 | break; |
|
- | 861 | case 5: |
|
- | 862 | break; |
|
- | 863 | case 6: |
|
- | 864 | if(NaviData_WaypointNumber) HoTT_printfxy(0,6,"Active: %2d WPs",NaviData_WaypointNumber) |
|
- | 865 | else HoTT_printfxy(0,6,"No WPs active ") |
|
- | 866 | break; |
|
- | 867 | case 7: |
|
- | 868 | case 8: |
|
- | 869 | case 9: |
|
- | 870 | case 10: |
|
- | 871 | case 11: |
|
- | 872 | case 12: |
|
- | 873 | case 13: |
|
- | 874 | case 14: |
|
- | 875 | case 15: |
|
- | 876 | case 16: |
|
- | 877 | if(HottKeyboard == HOTT_KEY_UP && load_waypoint_tmp < 99) { changed = 1; load_waypoint_tmp++;} |
|
- | 878 | else |
|
- | 879 | if(HottKeyboard == HOTT_KEY_DOWN && load_waypoint_tmp) { changed = 1; load_waypoint_tmp--;}; |
|
- | 880 | ||
- | 881 | if(HottKeyboard == HOTT_KEY_SET) { if(load_waypoint_tmp) ToNC_Load_WP_List = load_waypoint_tmp; changed = 0;} |
|
- | 882 | else |
|
- | 883 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page = 4; line = 0;} |
|
- | 884 | else |
|
- | 885 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page = 2; line = 0;}; |
|
- | 886 | HottKeyboard = 0; |
|
- | 887 | break; |
|
- | 888 | default: line = 0; |
|
- | 889 | break; |
|
- | 890 | } |
|
- | 891 | else |
|
- | 892 | if(page == 4) |
|
- | 893 | switch(line++) |
|
- | 894 | { |
|
- | 895 | case 0: |
|
- | 896 | HoTT_printfxy(0,0,"Load Waypoints"); |
|
- | 897 | break; |
|
- | 898 | case 1: //HoTT_printfxy(0,1,"Min:%2i.%1iV %s ",BattLowVoltageWarning/10, BattLowVoltageWarning%10, Mixer.Name); |
|
- | 899 | HoTT_printfxy(0,1,"(Relative)"); |
|
- | 900 | break; |
|
- | 901 | case 2: |
|
- | 902 | if(load_waypoint_tmp2) |
|
- | 903 | { |
|
- | 904 | HoTT_printfxy(0,3,"Load list: ") |
|
- | 905 | if(changed && HoTTBlink) HoTT_printfxy(10,3," ", load_waypoint_tmp2) |
|
- | 906 | else HoTT_printfxy(10,3,"%2d ", load_waypoint_tmp2); |
|
- | 907 | } |
|
- | 908 | else |
|
- | 909 | { |
|
- | 910 | HoTT_printfxy(0,3,"Load list: -- "); |
|
- | 911 | } |
|
- | 912 | break; |
|
- | 913 | case 3: |
|
- | 914 | if(changed2 && load_waypoint_tmp2) HoTT_printfxy(0,4,"(Set -> Load)") |
|
- | 915 | else HoTT_printfxy(0,4," "); |
|
- | 916 | break; |
|
- | 917 | case 4: |
|
- | 918 | break; |
|
- | 919 | case 5: |
|
- | 920 | break; |
|
- | 921 | case 6: |
|
- | 922 | if(NaviData_WaypointNumber) HoTT_printfxy(0,6,"Active: %2d WPs",NaviData_WaypointNumber) |
|
- | 923 | else HoTT_printfxy(0,6,"No WPs active ") |
|
- | 924 | break; |
|
- | 925 | case 7: |
|
- | 926 | case 8: |
|
- | 927 | case 9: |
|
- | 928 | case 10: |
|
- | 929 | case 11: |
|
- | 930 | case 12: |
|
- | 931 | case 13: |
|
- | 932 | case 14: |
|
- | 933 | case 15: |
|
- | 934 | case 16: |
|
- | 935 | if(HottKeyboard == HOTT_KEY_UP && load_waypoint_tmp2 < 99) { changed2 = 1; load_waypoint_tmp2++;} |
|
- | 936 | else |
|
- | 937 | if(HottKeyboard == HOTT_KEY_DOWN && load_waypoint_tmp2) { changed2 = 1; load_waypoint_tmp2--;}; |
|
- | 938 | ||
- | 939 | if(HottKeyboard == HOTT_KEY_SET) { if(load_waypoint_tmp2) ToNC_Load_WP_List = load_waypoint_tmp2 | 128; changed2 = 0;} |
|
- | 940 | // else |
|
- | 941 | // if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page = 5; line = 0;} |
|
- | 942 | else |
|
- | 943 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page = 3; line = 0;}; |
|
- | 944 | HottKeyboard = 0; |
|
- | 945 | break; |
|
- | 946 | default: line = 0; |
|
- | 947 | break; |
|
- | 948 | } |
|
- | 949 | ||
832 | /* else |
950 | /* else |
833 | if(page == 3) |
951 | if(page == 3) |
834 | switch(line++) |
952 | switch(line++) |
835 | { |
953 | { |
836 | case 0: |
954 | case 0: |
837 | HoTT_printfxy(0,2,"Speak:"); |
955 | HoTT_printfxy(0,2,"Speak:"); |
838 | break; |
956 | break; |
839 | case 1: |
957 | case 1: |
840 | // if(GetParamByte(PID_SPEAK_HOTT_CFG) & 0x01) |
958 | // if(GetParamByte(PID_SPEAK_HOTT_CFG) & 0x01) |
841 | if(!(GlobalConfig3 & CFG3_SPEAK_ALL) & 0x01)) HoTT_printfxy_INV(7,2,"All Messages ") |
959 | if(!(GlobalConfig3 & CFG3_SPEAK_ALL) & 0x01)) HoTT_printfxy_INV(7,2,"All Messages ") |
842 | else HoTT_printfxy_INV(7,2,"Warnings only"); |
960 | else HoTT_printfxy_INV(7,2,"Warnings only"); |
843 | break; |
961 | break; |
844 | case 2: |
962 | case 2: |
845 | HoTT_printfxy(1,4,"Use (set) to select"); |
963 | HoTT_printfxy(1,4,"Use (set) to select"); |
846 | break; |
964 | break; |
847 | default: |
965 | default: |
848 | if(HottKeyboard == HOTT_KEY_SET) |
966 | if(HottKeyboard == HOTT_KEY_SET) |
849 | { |
967 | { |
850 | SetParamByte(PID_SPEAK_HOTT_CFG, GetParamByte(PID_SPEAK_HOTT_CFG) ^ 0x01); |
968 | SetParamByte(PID_SPEAK_HOTT_CFG, GetParamByte(PID_SPEAK_HOTT_CFG) ^ 0x01); |
851 | } |
969 | } |
852 | else |
970 | else |
853 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page = 2; line = 0;}; |
971 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page = 2; line = 0;}; |
854 | HottKeyboard = 0; |
972 | HottKeyboard = 0; |
855 | line = 0; |
973 | line = 0; |
856 | break; |
974 | break; |
857 | } |
975 | } |
858 | */ |
976 | */ |
859 | else page = 0; |
977 | else page = 0; |
860 | } |
978 | } |
861 | 979 | ||
862 | #endif |
980 | #endif |
863 | 981 | ||
864 | 982 | ||
865 | 983 | ||
866 | 984 |