Rev 2146 | Rev 2183 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2146 | Rev 2178 | ||
---|---|---|---|
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 | ||
- | 82 | unsigned char NaviData_WaypointIndex = 0, NaviData_WaypointNumber = 0, NaviData_TargetHoldTime = 0; |
|
- | 83 | unsigned int NaviData_TargetDistance = 0; |
|
81 | 84 | ||
82 | GPSPacket_t GPSPacket; |
85 | GPSPacket_t GPSPacket; |
83 | VarioPacket_t VarioPacket; |
86 | VarioPacket_t VarioPacket; |
84 | ASCIIPacket_t ASCIIPacket; |
87 | ASCIIPacket_t ASCIIPacket; |
85 | ElectricAirPacket_t ElectricAirPacket; |
88 | ElectricAirPacket_t ElectricAirPacket; |
86 | HoTTGeneral_t HoTTGeneral; |
89 | HoTTGeneral_t HoTTGeneral; |
87 | unsigned char SpeakHoTT = SPEAK_MIKROKOPTER; |
90 | unsigned char SpeakHoTT = SPEAK_MIKROKOPTER; |
88 | int HoTTVarioMeter = 0; |
91 | int HoTTVarioMeter = 0; |
89 | const char PROGMEM MIKROKOPTER[] = {" MikroKopter "}; |
92 | const char PROGMEM MIKROKOPTER[] = {" MikroKopter "}; |
90 | const char PROGMEM UNDERVOLTAGE[] = {" !! LiPo voltage !! "}; |
93 | const char PROGMEM UNDERVOLTAGE[] = {" !! LiPo voltage !! "}; |
91 | const char PROGMEM NC_ERROR_TEXT[MAX_ERR_NUMBER][17] = |
94 | const char PROGMEM NC_ERROR_TEXT[MAX_ERR_NUMBER][17] = |
92 | { |
95 | { |
93 | //0123456789123456 |
96 | //0123456789123456 |
94 | "No Error \0", // 0 |
97 | "No Error \0", // 0 |
95 | "Not compatible \0", // 1 |
98 | "Not compatible \0", // 1 |
96 | "MK3Mag not compa\0", // 2 |
99 | "MK3Mag not compa\0", // 2 |
97 | "No FC communicat\0", // 3 |
100 | "No FC communicat\0", // 3 |
98 | "MK3Mag communica\0", // 4 |
101 | "MK3Mag communica\0", // 4 |
99 | "GPS communicatio\0", // 5 |
102 | "GPS communicatio\0", // 5 |
100 | "compass value \0", // 6 |
103 | "compass value \0", // 6 |
101 | "RC Signal lost \0", // 7 |
104 | "RC Signal lost \0", // 7 |
102 | "FC spi rx error \0", // 8 |
105 | "FC spi rx error \0", // 8 |
103 | "No NC communicat\0", // 9 |
106 | "No NC communicat\0", // 9 |
104 | "FC Nick Gyro \0", // 10 |
107 | "FC Nick Gyro \0", // 10 |
105 | "FC Roll Gyro \0", // 11 |
108 | "FC Roll Gyro \0", // 11 |
106 | "FC Yaw Gyro \0", // 12 |
109 | "FC Yaw Gyro \0", // 12 |
107 | "FC Nick ACC \0", // 13 |
110 | "FC Nick ACC \0", // 13 |
108 | "FC Roll ACC \0", // 14 |
111 | "FC Roll ACC \0", // 14 |
109 | "FC Z-ACC \0", // 15 |
112 | "FC Z-ACC \0", // 15 |
110 | "Pressure sensor \0", // 16 |
113 | "Pressure sensor \0", // 16 |
111 | "I2C FC->BL-Ctrl \0", // 17 |
114 | "I2C FC->BL-Ctrl \0", // 17 |
112 | "Bl Missing \0", // 18 |
115 | "Bl Missing \0", // 18 |
113 | "Mixer Error \0", // 19 |
116 | "Mixer Error \0", // 19 |
114 | "Carefree Error \0", // 20 |
117 | "Carefree Error \0", // 20 |
115 | "GPS Fix lost \0", // 21 |
118 | "GPS Fix lost \0", // 21 |
116 | "Magnet Error \0", // 22 |
119 | "Magnet Error \0", // 22 |
117 | "Motor restart \0", // 23 |
120 | "Motor restart \0", // 23 |
118 | "BL Limitation \0", // 24 |
121 | "BL Limitation \0", // 24 |
119 | "GPS Range \0", // 25 |
122 | "GPS Range \0", // 25 |
120 | "No SD-Card \0", // 26 |
123 | "No SD-Card \0", // 26 |
121 | "SD-Logging error\0", // 27 |
124 | "SD-Logging error\0", // 27 |
122 | "Flying range! \0", // 28 |
125 | "Flying range! \0", // 28 |
123 | "Max Altitude! \0", // 29 |
126 | "Max Altitude! \0", // 29 |
124 | "No GPS fix \0" // 30 |
127 | "No GPS fix \0" // 30 |
125 | }; |
128 | }; |
126 | 129 | ||
127 | 130 | ||
128 | const char PROGMEM HOTT_ERROR[MAX_ERR_NUMBER][2] = |
131 | const char PROGMEM HOTT_ERROR[MAX_ERR_NUMBER][2] = |
129 | { // 1 -> only in flight 0 -> also on ground |
132 | { // 1 -> only in flight 0 -> also on ground |
130 | //0123456789123456 |
133 | //0123456789123456 |
131 | {0,0},// "No Error \0", // 0 |
134 | {0,0},// "No Error \0", // 0 |
132 | {SPEAK_ERROR,0},// "Not compatible \0", // 1 |
135 | {SPEAK_ERROR,0},// "Not compatible \0", // 1 |
133 | {SPEAK_ERROR,0},// "MK3Mag not compa\0", // 2 |
136 | {SPEAK_ERROR,0},// "MK3Mag not compa\0", // 2 |
134 | {SPEAK_ERR_NAVI,1},// "No FC communicat\0", // 3 |
137 | {SPEAK_ERR_NAVI,1},// "No FC communicat\0", // 3 |
135 | {SPEAK_ERR_COMPASS,1},// "MK3Mag communica\0", // 4 |
138 | {SPEAK_ERR_COMPASS,1},// "MK3Mag communica\0", // 4 |
136 | {SPEAK_ERR_GPS,0},// "GPS communicatio\0", // 5 |
139 | {SPEAK_ERR_GPS,0},// "GPS communicatio\0", // 5 |
137 | {SPEAK_ERR_COMPASS,1},// "compass value \0", // 6 |
140 | {SPEAK_ERR_COMPASS,1},// "compass value \0", // 6 |
138 | {SPEAK_ERR_RECEICER,0},// "RC Signal lost \0", // 7 |
141 | {SPEAK_ERR_RECEICER,0},// "RC Signal lost \0", // 7 |
139 | {SPEAK_ERR_NAVI,0},// "FC spi rx error \0", // 8 |
142 | {SPEAK_ERR_NAVI,0},// "FC spi rx error \0", // 8 |
140 | {SPEAK_ERR_NAVI,0},// "No NC communicat\0", // 9 |
143 | {SPEAK_ERR_NAVI,0},// "No NC communicat\0", // 9 |
141 | {SPEAK_ERR_SENSOR,0},// "FC Nick Gyro \0", // 10 |
144 | {SPEAK_ERR_SENSOR,0},// "FC Nick Gyro \0", // 10 |
142 | {SPEAK_ERR_SENSOR,0},// "FC Roll Gyro \0", // 11 |
145 | {SPEAK_ERR_SENSOR,0},// "FC Roll Gyro \0", // 11 |
143 | {SPEAK_ERR_SENSOR,0},// "FC Yaw Gyro \0", // 12 |
146 | {SPEAK_ERR_SENSOR,0},// "FC Yaw Gyro \0", // 12 |
144 | {SPEAK_ERR_SENSOR,0},// "FC Nick ACC \0", // 13 |
147 | {SPEAK_ERR_SENSOR,0},// "FC Nick ACC \0", // 13 |
145 | {SPEAK_ERR_SENSOR,0},// "FC Roll ACC \0", // 14 |
148 | {SPEAK_ERR_SENSOR,0},// "FC Roll ACC \0", // 14 |
146 | {SPEAK_ERR_SENSOR,0},// "FC Z-ACC \0", // 15 |
149 | {SPEAK_ERR_SENSOR,0},// "FC Z-ACC \0", // 15 |
147 | {SPEAK_ERR_SENSOR,0},// "Pressure sensor \0", // 16 |
150 | {SPEAK_ERR_SENSOR,0},// "Pressure sensor \0", // 16 |
148 | {SPEAK_ERR_DATABUS,1},// "I2C FC->BL-Ctrl \0", // 17 |
151 | {SPEAK_ERR_DATABUS,1},// "I2C FC->BL-Ctrl \0", // 17 |
149 | {SPEAK_ERR_DATABUS,1},// "Bl Missing \0", // 18 |
152 | {SPEAK_ERR_DATABUS,1},// "Bl Missing \0", // 18 |
150 | {SPEAK_ERROR,0},// "Mixer Error \0", // 19 |
153 | {SPEAK_ERROR,0},// "Mixer Error \0", // 19 |
151 | {SPEAK_CF_OFF,1},// "Carefree Error \0", // 20 |
154 | {SPEAK_CF_OFF,1},// "Carefree Error \0", // 20 |
152 | {SPEAK_GPS_FIX,1},// "GPS Fix lost \0", // 21 |
155 | {SPEAK_GPS_FIX,1},// "GPS Fix lost \0", // 21 |
153 | {SPEAK_ERR_COMPASS,0},// "Magnet Error \0", // 22 |
156 | {SPEAK_ERR_COMPASS,0},// "Magnet Error \0", // 22 |
154 | {SPEAK_ERR_MOTOR,1},// "Motor restart \0", // 23 |
157 | {SPEAK_ERR_MOTOR,1},// "Motor restart \0", // 23 |
155 | {SPEAK_MAX_TEMPERAT,1},// "BL Limitation \0", // 24 |
158 | {SPEAK_MAX_TEMPERAT,1},// "BL Limitation \0", // 24 |
156 | {SPEAK_MAX_RANGE,1},// "GPS Range \0", // 25 |
159 | {SPEAK_MAX_RANGE,1},// "GPS Range \0", // 25 |
157 | {SPEAK_ERROR,1},// "No SD-Card \0", // 26 |
160 | {SPEAK_ERROR,1},// "No SD-Card \0", // 26 |
158 | {SPEAK_ERROR,1},// "SD-Logging error\0", // 27 |
161 | {SPEAK_ERROR,1},// "SD-Logging error\0", // 27 |
159 | {SPEAK_MAX_RANGE,1},// "Flying range! \0", // 28 |
162 | {SPEAK_MAX_RANGE,1},// "Flying range! \0", // 28 |
160 | {SPEAK_MAX_ALTITUD,1},// "Max Altitude! \0" // 29 |
163 | {SPEAK_MAX_ALTITUD,1},// "Max Altitude! \0" // 29 |
161 | {SPEAK_GPS_FIX,1}// "no GPS Fix, // 30 |
164 | {SPEAK_GPS_FIX,1}// "no GPS Fix, // 30 |
162 | }; |
165 | }; |
163 | 166 | ||
164 | 167 | ||
165 | unsigned char MaxBlTempertaure = 0; |
168 | unsigned char MaxBlTempertaure = 0; |
166 | unsigned char MinBlTempertaure = 0; |
169 | unsigned char MinBlTempertaure = 0; |
167 | unsigned char HottestBl = 0; |
170 | unsigned char HottestBl = 0; |
168 | 171 | ||
169 | void GetHottestBl(void) |
172 | void GetHottestBl(void) |
170 | { |
173 | { |
171 | static unsigned char search = 0,tmp_max,tmp_min,who; |
174 | static unsigned char search = 0,tmp_max,tmp_min,who; |
172 | if(Motor[search].Temperature > tmp_max) { tmp_max = Motor[search].Temperature; who = search;} |
175 | if(Motor[search].Temperature > tmp_max) { tmp_max = Motor[search].Temperature; who = search;} |
173 | else |
176 | else |
174 | if(Motor[search].Temperature) if(Motor[search].Temperature < tmp_min) tmp_min = Motor[search].Temperature; |
177 | if(Motor[search].Temperature) if(Motor[search].Temperature < tmp_min) tmp_min = Motor[search].Temperature; |
175 | if(++search > MAX_MOTORS) |
178 | if(++search > MAX_MOTORS) |
176 | { |
179 | { |
177 | search = 0; |
180 | search = 0; |
178 | if(tmp_min != 255) MinBlTempertaure = tmp_min; else MinBlTempertaure = 0; |
181 | if(tmp_min != 255) MinBlTempertaure = tmp_min; else MinBlTempertaure = 0; |
179 | MaxBlTempertaure = tmp_max; |
182 | MaxBlTempertaure = tmp_max; |
180 | HottestBl = who; |
183 | HottestBl = who; |
181 | tmp_min = 255; |
184 | tmp_min = 255; |
182 | tmp_max = 0; |
185 | tmp_max = 0; |
183 | who = 0; |
186 | who = 0; |
184 | } |
187 | } |
185 | } |
188 | } |
186 | 189 | ||
187 | //--------------------------------------------------------------- |
190 | //--------------------------------------------------------------- |
188 | void Hott_ClearLine(unsigned char line) |
191 | void Hott_ClearLine(unsigned char line) |
189 | { |
192 | { |
190 | HoTT_printfxy(0,line," "); |
193 | HoTT_printfxy(0,line," "); |
191 | } |
194 | } |
192 | //--------------------------------------------------------------- |
195 | //--------------------------------------------------------------- |
- | 196 | ||
193 | 197 | ||
194 | unsigned char HoTT_Waring(void) |
198 | unsigned char HoTT_Waring(void) |
195 | { |
199 | { |
196 | unsigned char status = 0; |
200 | unsigned char status = 0; |
197 | static char old_status = 0; |
201 | static char old_status = 0; |
198 | static int repeat; |
202 | static int repeat; |
199 | //if(Parameter_UserParam1) return(Parameter_UserParam1); |
203 | //if(Parameter_UserParam1) return(Parameter_UserParam1); |
200 | //DebugOut.Analog[16] = 0; |
204 | //DebugOut.Analog[16] = 0; |
201 | if(FC_StatusFlags & FC_STATUS_LOWBAT) status = VOICE_MINIMALE_EINGANSSPANNUNG; |
205 | if(FC_StatusFlags & FC_STATUS_LOWBAT) status = VOICE_MINIMALE_EINGANSSPANNUNG; |
202 | else |
206 | else |
203 | if(NC_ErrorCode) |
207 | if(NC_ErrorCode) |
204 | { |
208 | { |
205 | if(MotorenEin || !pgm_read_byte(&HOTT_ERROR[NC_ErrorCode][1])) status = pgm_read_byte(&HOTT_ERROR[NC_ErrorCode][0]); |
209 | if(MotorenEin || !pgm_read_byte(&HOTT_ERROR[NC_ErrorCode][1])) status = pgm_read_byte(&HOTT_ERROR[NC_ErrorCode][0]); |
206 | } |
210 | } |
207 | 211 | ||
208 | if(!status) |
212 | if(!status) |
209 | { |
213 | { |
210 | if(!(GetParamByte(PID_SPEAK_HOTT_CFG) & 0x01)) SpeakHoTT = 0; // is the voice wanted? |
214 | if(!(GetParamByte(PID_SPEAK_HOTT_CFG) & 0x01)) SpeakHoTT = 0; // is the voice wanted? |
211 | else status = SpeakHoTT; |
215 | else status = SpeakHoTT; |
212 | }; |
216 | }; |
213 | 217 | ||
214 | if(old_status == status) |
218 | if(old_status == status) |
215 | { |
219 | { |
216 | if(!CheckDelay(repeat)) return(0); |
220 | if(!CheckDelay(repeat)) return(0); |
217 | repeat = SetDelay(5000); |
221 | repeat = SetDelay(5000); |
218 | } |
222 | } |
219 | else repeat = SetDelay(2000); |
223 | else repeat = SetDelay(2000); |
220 | 224 | ||
221 | if(status) |
225 | if(status) |
222 | { |
226 | { |
223 | if(status == SpeakHoTT) SpeakHoTT = 0; |
227 | if(status == SpeakHoTT) SpeakHoTT = 0; |
224 | } |
228 | } |
225 | old_status = status; |
229 | old_status = status; |
226 | // DebugOut.Analog[16] = status; |
230 | // DebugOut.Analog[16] = status; |
227 | return(status); |
231 | return(status); |
228 | } |
232 | } |
- | 233 | ||
- | 234 | /* |
|
- | 235 | unsigned char HoTTErrorCode(void) |
|
- | 236 | { |
|
- | 237 | return(NC_ErrorCode); |
|
- | 238 | } |
|
229 | 239 | */ |
|
230 | //--------------------------------------------------------------- |
240 | //--------------------------------------------------------------- |
231 | void NC_Fills_HoTT_Telemety(void) |
241 | void NC_Fills_HoTT_Telemety(void) |
232 | { |
242 | { |
233 | unsigned char *ptr = NULL; |
243 | unsigned char *ptr = NULL; |
234 | unsigned char max = 0,i,z; |
244 | unsigned char max = 0,i,z; |
235 | switch(FromNaviCtrl.Param.Byte[11]) |
245 | switch(FromNaviCtrl.Param.Byte[11]) |
236 | { |
246 | { |
237 | case HOTT_VARIO_PACKET_ID: |
247 | case HOTT_VARIO_PACKET_ID: |
238 | ptr = (unsigned char *) &VarioPacket; |
248 | ptr = (unsigned char *) &VarioPacket; |
239 | max = sizeof(VarioPacket); |
249 | max = sizeof(VarioPacket); |
240 | break; |
250 | break; |
241 | case HOTT_GPS_PACKET_ID: |
251 | case HOTT_GPS_PACKET_ID: |
242 | ptr = (unsigned char *) &GPSPacket; |
252 | ptr = (unsigned char *) &GPSPacket; |
243 | max = sizeof(GPSPacket); |
253 | max = sizeof(GPSPacket); |
244 | break; |
254 | break; |
245 | case HOTT_ELECTRIC_AIR_PACKET_ID: |
255 | case HOTT_ELECTRIC_AIR_PACKET_ID: |
246 | ptr = (unsigned char *) &ElectricAirPacket; |
256 | ptr = (unsigned char *) &ElectricAirPacket; |
247 | max = sizeof(ElectricAirPacket); |
257 | max = sizeof(ElectricAirPacket); |
248 | break; |
258 | break; |
249 | case HOTT_GENERAL_PACKET_ID: |
259 | case HOTT_GENERAL_PACKET_ID: |
250 | ptr = (unsigned char *) &HoTTGeneral; |
260 | ptr = (unsigned char *) &HoTTGeneral; |
251 | max = sizeof(HoTTGeneral); |
261 | max = sizeof(HoTTGeneral); |
252 | break; |
262 | break; |
253 | } |
263 | } |
254 | z = FromNaviCtrl.Param.Byte[0]; // Data allocation |
264 | z = FromNaviCtrl.Param.Byte[0]; // Data allocation |
255 | 265 | ||
256 | for(i=0; i < FromNaviCtrl.Param.Byte[1]; i++) |
266 | for(i=0; i < FromNaviCtrl.Param.Byte[1]; i++) |
257 | { |
267 | { |
258 | if(z >= max) break; |
268 | if(z >= max) break; |
259 | ptr[z] = FromNaviCtrl.Param.Byte[2+i]; |
269 | ptr[z] = FromNaviCtrl.Param.Byte[2+i]; |
260 | z++; |
270 | z++; |
261 | } |
271 | } |
262 | } |
272 | } |
263 | 273 | ||
264 | unsigned int BuildHoTT_Vario(void) |
274 | unsigned int BuildHoTT_Vario(void) |
265 | { |
275 | { |
266 | unsigned int tmp = 30000; |
276 | unsigned int tmp = 30000; |
267 | if(VarioCharacter == '+' || VarioCharacter == '-') |
277 | if(VarioCharacter == '+' || VarioCharacter == '-') |
268 | { |
278 | { |
269 | tmp = 30000 + (AltitudeSetpointTrimming * EE_Parameter.Hoehe_Verstaerkung) / 3; |
279 | tmp = 30000 + (AltitudeSetpointTrimming * EE_Parameter.Hoehe_Verstaerkung) / 3; |
270 | if(tmp < 30000 && tmp > 30000 - 50) tmp = 30000 - 50; // weil es sonst erst bei < 0,5m/sek piept |
280 | if(tmp < 30000 && tmp > 30000 - 50) tmp = 30000 - 50; // weil es sonst erst bei < 0,5m/sek piept |
271 | } |
281 | } |
272 | else |
282 | else |
273 | if((VarioCharacter == ' ') && (FC_StatusFlags & FC_STATUS_FLY)) |
283 | if((VarioCharacter == ' ') && (FC_StatusFlags & FC_STATUS_FLY)) |
274 | { |
284 | { |
275 | tmp = 30000 + HoTTVarioMeter; |
285 | tmp = 30000 + HoTTVarioMeter; |
276 | if(tmp > 30000) |
286 | if(tmp > 30000) |
277 | { |
287 | { |
278 | if(tmp < 30000 + 100) tmp = 30000; |
288 | if(tmp < 30000 + 100) tmp = 30000; |
279 | else tmp -= 100; |
289 | else tmp -= 100; |
280 | } |
290 | } |
281 | if(tmp < 30000) |
291 | if(tmp < 30000) |
282 | { |
292 | { |
283 | if(tmp > 30000 - 100) tmp = 30000; |
293 | if(tmp > 30000 - 100) tmp = 30000; |
284 | else tmp += 100; |
294 | else tmp += 100; |
285 | } |
295 | } |
286 | } |
296 | } |
287 | else |
297 | else |
288 | if(VarioCharacter == '^') tmp = 30000 + FromNC_AltitudeSpeed * 10; |
298 | if(VarioCharacter == '^') tmp = 30000 + FromNC_AltitudeSpeed * 10; |
289 | else |
299 | else |
290 | if(VarioCharacter == 'v') tmp = 30000 - FromNC_AltitudeSpeed * 10; |
300 | if(VarioCharacter == 'v') tmp = 30000 - FromNC_AltitudeSpeed * 10; |
291 | 301 | ||
292 | return(tmp); |
302 | return(tmp); |
293 | } |
303 | } |
294 | - | ||
295 | 304 | ||
296 | //--------------------------------------------------------------- |
305 | //--------------------------------------------------------------- |
297 | unsigned char HoTT_Telemety(unsigned char packet_request) |
306 | unsigned char HoTT_Telemety(unsigned char packet_request) |
298 | { |
307 | { |
299 | unsigned char i; |
308 | unsigned char i; |
300 | //Debug("rqst: %02X",packet_request); |
309 | //Debug("rqst: %02X",packet_request); |
301 | 310 | ||
302 | switch(packet_request) |
311 | switch(packet_request) |
303 | { |
312 | { |
304 | case HOTT_VARIO_PACKET_ID: |
313 | case HOTT_VARIO_PACKET_ID: |
305 | VarioPacket.Altitude = HoehenWert/100 + 500; |
314 | VarioPacket.Altitude = HoehenWert/100 + 500; |
306 | VarioPacket.m_sec = BuildHoTT_Vario(); |
315 | VarioPacket.m_sec = BuildHoTT_Vario(); |
307 | VarioPacket.m_3sec = VarioPacket.m_sec; |
316 | VarioPacket.m_3sec = VarioPacket.m_sec; |
308 | VarioPacket.m_10sec = VarioPacket.m_sec; |
317 | VarioPacket.m_10sec = VarioPacket.m_sec; |
309 | if (VarioPacket.Altitude < VarioPacket.MinAltitude) VarioPacket.MinAltitude = VarioPacket.Altitude; |
318 | if (VarioPacket.Altitude < VarioPacket.MinAltitude) VarioPacket.MinAltitude = VarioPacket.Altitude; |
310 | if (VarioPacket.Altitude > VarioPacket.MaxAltitude) VarioPacket.MaxAltitude = VarioPacket.Altitude; |
319 | if (VarioPacket.Altitude > VarioPacket.MaxAltitude) VarioPacket.MaxAltitude = VarioPacket.Altitude; |
311 | VarioPacket.WarnBeep = 0;//HoTT_Waring(); |
320 | VarioPacket.WarnBeep = 0;//HoTT_Waring(); |
312 | HoTT_DataPointer = (unsigned char *) &VarioPacket; |
321 | HoTT_DataPointer = (unsigned char *) &VarioPacket; |
313 | VarioPacket.FreeCharacters[0] = VarioCharacter; |
322 | VarioPacket.FreeCharacters[0] = VarioCharacter; |
314 | if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) VarioPacket.FreeCharacters[1] = 'C'; else VarioPacket.FreeCharacters[1] = ' '; |
323 | if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) VarioPacket.FreeCharacters[1] = 'C'; else VarioPacket.FreeCharacters[1] = ' '; |
315 | // VarioPacket.FreeCharacters[2] = ' '; |
324 | // VarioPacket.FreeCharacters[2] = ' '; |
316 | if(NC_ErrorCode) |
325 | if(NC_ErrorCode) |
317 | { |
326 | { |
318 | for(i=0; i<16;i++) VarioPacket.Text[i+4] = pgm_read_byte(&NC_ERROR_TEXT[NC_ErrorCode][i]); |
327 | for(i=0; i<16;i++) VarioPacket.Text[i+4] = pgm_read_byte(&NC_ERROR_TEXT[NC_ErrorCode][i]); |
319 | VarioPacket.Text[0] = NC_ErrorCode/10 + '0'; |
328 | VarioPacket.Text[0] = NC_ErrorCode/10 + '0'; |
320 | VarioPacket.Text[1] = NC_ErrorCode%10 + '0'; |
329 | VarioPacket.Text[1] = NC_ErrorCode%10 + '0'; |
321 | VarioPacket.Text[2] = ':'; |
330 | VarioPacket.Text[2] = ':'; |
322 | } |
331 | } |
323 | else |
332 | else |
324 | if(FC_StatusFlags & FC_STATUS_LOWBAT) for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&UNDERVOLTAGE[i]); // no Error |
333 | if(FC_StatusFlags & FC_STATUS_LOWBAT) for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&UNDERVOLTAGE[i]); // no Error |
325 | else |
334 | else |
- | 335 | if(NaviData_WaypointNumber) |
|
- | 336 | { |
|
- | 337 | unsigned int tmp_int; |
|
- | 338 | unsigned char tmp; |
|
- | 339 | VarioPacket.Text[0] = 'W'; VarioPacket.Text[1] = 'P'; |
|
- | 340 | VarioPacket.Text[2] = ' '; |
|
- | 341 | VarioPacket.Text[3] = '0'+(NaviData_WaypointIndex) / 10; |
|
- | 342 | VarioPacket.Text[4] = '0'+(NaviData_WaypointIndex) % 10; |
|
- | 343 | VarioPacket.Text[5] = '/'; |
|
- | 344 | VarioPacket.Text[6] = '0'+(NaviData_WaypointNumber) / 10; |
|
- | 345 | VarioPacket.Text[7] = '0'+(NaviData_WaypointNumber) % 10; |
|
- | 346 | VarioPacket.Text[8] = ' '; |
|
- | 347 | tmp_int = NaviData_TargetDistance; |
|
- | 348 | if(tmp_int > 1000) { VarioPacket.Text[9] = '0'+(tmp_int) / 1000; tmp_int %= 1000;} |
|
- | 349 | else VarioPacket.Text[9] = ' '; |
|
- | 350 | if(tmp_int > 100) { VarioPacket.Text[10] = '0'+(tmp_int) / 100; tmp_int %= 100;} |
|
- | 351 | else VarioPacket.Text[10] = ' '; |
|
- | 352 | VarioPacket.Text[11] = '0'+(tmp_int) / 10; |
|
- | 353 | VarioPacket.Text[12] = '0'+(tmp_int) % 10; |
|
- | 354 | VarioPacket.Text[13] = 'm'; |
|
- | 355 | VarioPacket.Text[14] = ' '; |
|
- | 356 | tmp = NaviData_TargetHoldTime; |
|
- | 357 | if(tmp > 100) { VarioPacket.Text[15] = '0'+(tmp) / 100; tmp %= 100;} else VarioPacket.Text[15] = ' '; |
|
- | 358 | VarioPacket.Text[16] = '0'+(tmp) / 10; |
|
- | 359 | VarioPacket.Text[17] = '0'+(tmp) % 10; |
|
- | 360 | VarioPacket.Text[18] = 's'; |
|
- | 361 | VarioPacket.Text[19] = ' '; |
|
- | 362 | //unsigned char NaviData_WaypointIndex = 0, NaviData_WaypointNumber = 0, NaviData_TargetHoldTime = 0; |
|
- | 363 | //unsigned int NaviData_TargetDistance = 0; |
|
- | 364 | } |
|
- | 365 | else |
|
326 | for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&MIKROKOPTER[i]); // no Error |
366 | for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&MIKROKOPTER[i]); // no Error |
327 | 367 | ||
328 | return(sizeof(VarioPacket)); |
368 | return(sizeof(VarioPacket)); |
329 | break; |
369 | break; |
330 | 370 | ||
331 | case HOTT_GPS_PACKET_ID: |
371 | case HOTT_GPS_PACKET_ID: |
332 | GPSPacket.Altitude = HoehenWert/100 + 500; |
372 | // GPSPacket.Altitude = HoehenWert/100 + 500; |
- | 373 | ||
- | 374 | GPSPacket.Altitude = DebugOut.Analog[17] + 500; |
|
333 | // GPSPacket.Distance = GPSInfo.HomeDistance/10; // macht die NC |
375 | // GPSPacket.Distance = GPSInfo.HomeDistance/10; // macht die NC |
334 | // GPSPacket.Heading = GPSInfo.HomeBearing/2; // macht die NC |
376 | // GPSPacket.Heading = GPSInfo.HomeBearing/2; // macht die NC |
335 | // GPSPacket.Speed = (GPSInfo.Speed * 36) / 10; // macht die NC |
377 | // GPSPacket.Speed = (GPSInfo.Speed * 36) / 10; // macht die NC |
336 | GPSPacket.m_sec = BuildHoTT_Vario(); |
378 | GPSPacket.m_sec = BuildHoTT_Vario(); |
337 | GPSPacket.m_3sec = 120; |
379 | GPSPacket.m_3sec = 120; |
338 | GPSPacket.NumOfSats = GPSInfo.NumOfSats; |
380 | GPSPacket.NumOfSats = GPSInfo.NumOfSats; |
339 | GPSPacket.WarnBeep = HoTT_Waring(); |
381 | GPSPacket.WarnBeep = HoTT_Waring(); |
340 | if(GPSInfo.Flags & FLAG_DIFFSOLN) GPSPacket.SatFix = 'D'; |
382 | if(GPSInfo.Flags & FLAG_DIFFSOLN) GPSPacket.SatFix = 'D'; |
341 | else |
383 | else |
342 | if(GPSInfo.SatFix == SATFIX_3D) GPSPacket.SatFix = ' '; |
384 | if(GPSInfo.SatFix == SATFIX_3D) GPSPacket.SatFix = ' '; |
343 | else GPSPacket.SatFix = '!'; |
385 | else GPSPacket.SatFix = '!'; |
344 | HoTT_DataPointer = (unsigned char *) &GPSPacket; |
386 | HoTT_DataPointer = (unsigned char *) &GPSPacket; |
345 | GPSPacket.FreeCharacters[0] = NC_GPS_ModeCharacter; |
387 | GPSPacket.FreeCharacters[0] = NC_GPS_ModeCharacter; |
346 | GPSPacket.FreeCharacters[2] = GPSPacket.SatFix; |
388 | GPSPacket.FreeCharacters[2] = GPSPacket.SatFix; |
347 | GPSPacket.HomeDirection = GPSInfo.HomeBearing / 2;//230; |
389 | GPSPacket.HomeDirection = GPSInfo.HomeBearing / 2;//230; |
348 | return(sizeof(GPSPacket)); |
390 | return(sizeof(GPSPacket)); |
349 | break; |
391 | break; |
350 | case HOTT_ELECTRIC_AIR_PACKET_ID: |
392 | case HOTT_ELECTRIC_AIR_PACKET_ID: |
351 | GetHottestBl(); |
393 | GetHottestBl(); |
352 | ElectricAirPacket.Altitude = HoehenWert/100 + 500; |
394 | ElectricAirPacket.Altitude = HoehenWert/100 + 500; |
353 | ElectricAirPacket.Battery1 = UBat; |
395 | ElectricAirPacket.Battery1 = UBat; |
354 | ElectricAirPacket.Battery2 = UBat; |
396 | ElectricAirPacket.Battery2 = UBat; |
355 | ElectricAirPacket.VoltageCell1 = ErsatzKompassInGrad / 2; |
397 | ElectricAirPacket.VoltageCell1 = ErsatzKompassInGrad / 2; |
356 | ElectricAirPacket.VoltageCell8 = ElectricAirPacket.VoltageCell1; |
398 | ElectricAirPacket.VoltageCell8 = ElectricAirPacket.VoltageCell1; |
357 | ElectricAirPacket.VoltageCell6 = GPSInfo.HomeBearing / 2; |
399 | ElectricAirPacket.VoltageCell6 = GPSInfo.HomeBearing / 2; |
358 | ElectricAirPacket.VoltageCell7 = GPSInfo.HomeDistance/20; |
400 | ElectricAirPacket.VoltageCell7 = GPSInfo.HomeDistance/20; |
359 | ElectricAirPacket.VoltageCell13 = ElectricAirPacket.VoltageCell6; |
401 | ElectricAirPacket.VoltageCell13 = ElectricAirPacket.VoltageCell6; |
360 | ElectricAirPacket.VoltageCell14 = ElectricAirPacket.VoltageCell7; |
402 | ElectricAirPacket.VoltageCell14 = ElectricAirPacket.VoltageCell7; |
361 | ElectricAirPacket.m_sec = BuildHoTT_Vario(); |
403 | ElectricAirPacket.m_sec = BuildHoTT_Vario(); |
362 | ElectricAirPacket.m_3sec = 120; |
404 | ElectricAirPacket.m_3sec = 120; |
363 | ElectricAirPacket.InputVoltage = UBat; |
405 | ElectricAirPacket.InputVoltage = UBat; |
364 | ElectricAirPacket.Temperature1 = MinBlTempertaure + 20; |
406 | ElectricAirPacket.Temperature1 = MinBlTempertaure + 20; |
365 | ElectricAirPacket.Temperature2 = MaxBlTempertaure + 20; |
407 | ElectricAirPacket.Temperature2 = MaxBlTempertaure + 20; |
366 | ElectricAirPacket.Capacity = Capacity.UsedCapacity/10; |
408 | ElectricAirPacket.Capacity = Capacity.UsedCapacity/10; |
367 | ElectricAirPacket.WarnBeep = 0;//HoTT_Waring(); |
409 | ElectricAirPacket.WarnBeep = 0;//HoTT_Waring(); |
368 | ElectricAirPacket.Current = Capacity.ActualCurrent; |
410 | ElectricAirPacket.Current = Capacity.ActualCurrent; |
369 | HoTT_DataPointer = (unsigned char *) &ElectricAirPacket; |
411 | HoTT_DataPointer = (unsigned char *) &ElectricAirPacket; |
370 | ElectricAirPacket.FlightTimeMinutes = FlugSekunden / 60; |
412 | ElectricAirPacket.FlightTimeMinutes = FlugSekunden / 60; |
371 | ElectricAirPacket.FlightTimeSeconds = FlugSekunden % 60; |
413 | ElectricAirPacket.FlightTimeSeconds = FlugSekunden % 60; |
372 | return(sizeof(ElectricAirPacket)); |
414 | return(sizeof(ElectricAirPacket)); |
373 | break; |
415 | break; |
374 | case HOTT_GENERAL_PACKET_ID: |
416 | case HOTT_GENERAL_PACKET_ID: |
375 | GetHottestBl(); |
417 | GetHottestBl(); |
376 | HoTTGeneral.Rpm = GPSInfo.HomeDistance/100; |
418 | HoTTGeneral.Rpm = GPSInfo.HomeDistance/100; |
377 | HoTTGeneral.VoltageCell1 = ErsatzKompassInGrad / 2; |
419 | HoTTGeneral.VoltageCell1 = ErsatzKompassInGrad / 2; |
378 | HoTTGeneral.VoltageCell6 = GPSInfo.HomeBearing / 2; |
420 | HoTTGeneral.VoltageCell6 = GPSInfo.HomeBearing / 2; |
379 | if(UBat > BattLowVoltageWarning + 5) HoTTGeneral.FuelPercent = (UBat - (BattLowVoltageWarning + 6)) * 3; |
421 | if(UBat > BattLowVoltageWarning + 5) HoTTGeneral.FuelPercent = (UBat - (BattLowVoltageWarning + 6)) * 3; |
380 | else HoTTGeneral.FuelPercent = 0; |
422 | else HoTTGeneral.FuelPercent = 0; |
381 | HoTTGeneral.FuelCapacity = HoehenWert/100; |
423 | HoTTGeneral.FuelCapacity = HoehenWert/100; |
382 | if(HoTTGeneral.FuelCapacity < 0) HoTTGeneral.FuelCapacity = 0; |
424 | if(HoTTGeneral.FuelCapacity < 0) HoTTGeneral.FuelCapacity = 0; |
383 | HoTTGeneral.Altitude = HoehenWert/100 + 500; |
425 | HoTTGeneral.Altitude = HoehenWert/100 + 500; |
384 | HoTTGeneral.Battery1 = UBat; |
426 | HoTTGeneral.Battery1 = UBat; |
385 | HoTTGeneral.Battery2 = UBat; |
427 | HoTTGeneral.Battery2 = UBat; |
386 | HoTTGeneral.m_sec = BuildHoTT_Vario(); |
428 | HoTTGeneral.m_sec = BuildHoTT_Vario(); |
387 | HoTTGeneral.m_3sec = 120; |
429 | HoTTGeneral.m_3sec = 120; |
388 | HoTTGeneral.InputVoltage = UBat; |
430 | HoTTGeneral.InputVoltage = UBat; |
389 | HoTTGeneral.Temperature1 = MinBlTempertaure + 20; |
431 | HoTTGeneral.Temperature1 = MinBlTempertaure + 20; |
390 | HoTTGeneral.Temperature2 = MaxBlTempertaure + 20; |
432 | HoTTGeneral.Temperature2 = MaxBlTempertaure + 20; |
391 | HoTTGeneral.Capacity = Capacity.UsedCapacity/10; |
433 | HoTTGeneral.Capacity = Capacity.UsedCapacity/10; |
392 | HoTTGeneral.WarnBeep = 0;//HoTT_Waring(); |
434 | HoTTGeneral.WarnBeep = 0;//HoTT_Waring(); |
393 | HoTTGeneral.Current = Capacity.ActualCurrent; |
435 | HoTTGeneral.Current = Capacity.ActualCurrent; |
- | 436 | //HoTTGeneral.ErrorNumber = HoTTErrorCode(); |
|
394 | HoTT_DataPointer = (unsigned char *) &HoTTGeneral; |
437 | HoTT_DataPointer = (unsigned char *) &HoTTGeneral; |
395 | return(sizeof(HoTTGeneral)); |
438 | return(sizeof(HoTTGeneral)); |
396 | break; |
439 | break; |
397 | default: return(0); |
440 | default: return(0); |
398 | } |
441 | } |
399 | } |
442 | } |
400 | 443 | ||
401 | //--------------------------------------------------------------- |
444 | //--------------------------------------------------------------- |
402 | void HoTT_Menu(void) |
445 | void HoTT_Menu(void) |
403 | { |
446 | { |
404 | static unsigned char line, page = 0,show_current = 0,show_mag = 0, show_poti = 0; |
447 | static unsigned char line, page = 0,show_current = 0,show_mag = 0, show_poti = 0; |
405 | unsigned char tmp; |
448 | unsigned char tmp; |
406 | HoTTVarioMeter = (HoTTVarioMeter * 7 + VarioMeter) / 8; |
449 | HoTTVarioMeter = (HoTTVarioMeter * 7 + VarioMeter) / 8; |
407 | 450 | ||
408 | if(page == 0) |
451 | if(page == 0) |
409 | switch(line++) |
452 | switch(line++) |
410 | { |
453 | { |
411 | case 0: |
454 | case 0: |
412 | if(FC_StatusFlags & FC_STATUS_LOWBAT) |
455 | if(FC_StatusFlags & FC_STATUS_LOWBAT) |
413 | HoTT_printfxy_BLINK(0,0," %2i.%1iV ",UBat/10, UBat%10) |
456 | HoTT_printfxy_BLINK(0,0," %2i.%1iV ",UBat/10, UBat%10) |
414 | else |
457 | else |
415 | HoTT_printfxy(0,0," %2i.%1iV ",UBat/10, UBat%10) |
458 | HoTT_printfxy(0,0," %2i.%1iV ",UBat/10, UBat%10) |
416 | 459 | ||
417 | if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG) |
460 | if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG) |
418 | { |
461 | { |
419 | if(HoehenReglerAktiv) HoTT_printfxy_INV(10,0,"ALT:%4im %c", (int16_t)(HoehenWert/100),VarioCharacter) |
462 | if(HoehenReglerAktiv) HoTT_printfxy_INV(10,0,"ALT:%4im %c", (int16_t)(HoehenWert/100),VarioCharacter) |
420 | else HoTT_printfxy(10,0,"ALT:%4im ", (int16_t)(HoehenWert/100)) |
463 | else HoTT_printfxy(10,0,"ALT:%4im ", (int16_t)(HoehenWert/100)) |
421 | } |
464 | } |
422 | else HoTT_printfxy(10,0,"ALT:---- "); |
465 | else HoTT_printfxy(10,0,"ALT:---- "); |
423 | break; |
466 | break; |
424 | case 1: |
467 | case 1: |
425 | if(FC_StatusFlags & FC_STATUS_LOWBAT) |
468 | if(FC_StatusFlags & FC_STATUS_LOWBAT) |
426 | HoTT_printfxy_BLINK(0,1," %2i:%02i ",FlugSekunden/60,FlugSekunden%60) |
469 | HoTT_printfxy_BLINK(0,1," %2i:%02i ",FlugSekunden/60,FlugSekunden%60) |
427 | else HoTT_printfxy(0,1," %2i:%02i ",FlugSekunden/60,FlugSekunden%60); |
470 | else HoTT_printfxy(0,1," %2i:%02i ",FlugSekunden/60,FlugSekunden%60); |
428 | HoTT_printfxy(10,1,"DIR: %3d%c",ErsatzKompassInGrad, HoTT_GRAD); |
471 | HoTT_printfxy(10,1,"DIR: %3d%c",ErsatzKompassInGrad, HoTT_GRAD); |
429 | if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) HoTT_printfxy_INV(20,1,"C") else HoTT_printfxy(20,1," "); |
472 | if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) HoTT_printfxy_INV(20,1,"C") else HoTT_printfxy(20,1," "); |
430 | break; |
473 | break; |
431 | case 2: |
474 | case 2: |
432 | if(FC_StatusFlags & FC_STATUS_LOWBAT) |
475 | if(FC_StatusFlags & FC_STATUS_LOWBAT) |
433 | HoTT_printfxy_BLINK(0,2," %5i ",Capacity.UsedCapacity) |
476 | HoTT_printfxy_BLINK(0,2," %5i ",Capacity.UsedCapacity) |
434 | else HoTT_printfxy(0,2," %5i ",Capacity.UsedCapacity); |
477 | else HoTT_printfxy(0,2," %5i ",Capacity.UsedCapacity); |
435 | HoTT_printfxy(12,2,"I:%2i.%1iA ",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10); |
478 | HoTT_printfxy(12,2,"I:%2i.%1iA ",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10); |
436 | break; |
479 | break; |
437 | case 3: |
480 | case 3: |
438 | HoTT_printfxy(9,0,":"); |
481 | HoTT_printfxy(9,0,":"); |
439 | HoTT_printfxy(9,1,":"); |
482 | HoTT_printfxy(9,1,":"); |
440 | HoTT_printfxy(9,2,":"); |
483 | HoTT_printfxy(9,2,":"); |
441 | HoTT_printfxy(0,3,"---------+-----------"); |
484 | HoTT_printfxy(0,3,"---------+-----------"); |
442 | 485 | ||
443 | // HoTT_printfxy(0,3,"---------------------"); |
486 | // HoTT_printfxy(0,3,"---------------------"); |
444 | HoTT_printfxy(0,6,"---------------------"); |
487 | HoTT_printfxy(0,6,"---------------------"); |
445 | break; |
488 | break; |
446 | case 4: |
489 | case 4: |
447 | if(NaviDataOkay) |
490 | if(NaviDataOkay) |
448 | { |
491 | { |
449 | HoTT_printfxy(9,4,":"); |
492 | HoTT_printfxy(9,4,":"); |
450 | HoTT_printfxy(0,4,"SAT:%2d ",GPSInfo.NumOfSats); |
493 | HoTT_printfxy(0,4,"SAT:%2d ",GPSInfo.NumOfSats); |
451 | HoTT_printfxy(10,4,"DIST:%3dm",GPSInfo.HomeDistance/10); |
494 | HoTT_printfxy(10,4,"DIST:%3dm",GPSInfo.HomeDistance/10); |
452 | switch (GPSInfo.SatFix) |
495 | switch (GPSInfo.SatFix) |
453 | { |
496 | { |
454 | case SATFIX_3D: |
497 | case SATFIX_3D: |
455 | if(GPSInfo.Flags & FLAG_DIFFSOLN) HoTT_printfxy(7,4,"D ") |
498 | if(GPSInfo.Flags & FLAG_DIFFSOLN) HoTT_printfxy(7,4,"D ") |
456 | else HoTT_printfxy(7,4,"3D"); |
499 | else HoTT_printfxy(7,4,"3D"); |
457 | break; |
500 | break; |
458 | default: |
501 | default: |
459 | HoTT_printfxy_BLINK(7,4,"!!"); |
502 | HoTT_printfxy_BLINK(7,4,"!!"); |
460 | break; |
503 | break; |
461 | } |
504 | } |
462 | } |
505 | } |
463 | else |
506 | else |
464 | { |
507 | { |
465 | Hott_ClearLine(4); |
508 | Hott_ClearLine(4); |
466 | } |
509 | } |
467 | break; |
510 | break; |
468 | case 5: |
511 | case 5: |
469 | if(NaviDataOkay) |
512 | if(NaviDataOkay) |
470 | { |
513 | { |
471 | if(show_mag) |
514 | if(show_mag) |
472 | { |
515 | { |
473 | HoTT_printfxy(0,5,"MAG:%3u%% ",EarthMagneticField); |
516 | HoTT_printfxy(0,5,"MAG:%3u%% ",EarthMagneticField); |
474 | HoTT_printfxy(12,5,"HM:%3d%c %c", GPSInfo.HomeBearing, HoTT_GRAD, NC_GPS_ModeCharacter); |
517 | HoTT_printfxy(12,5,"HM:%3d%c %c", GPSInfo.HomeBearing, HoTT_GRAD, NC_GPS_ModeCharacter); |
475 | HoTT_printfxy(9,5,"incl:%2d%c(%2i)",EarthMagneticInclination, HoTT_GRAD,EarthMagneticInclinationTheoretic); |
518 | HoTT_printfxy(9,5,"incl:%2d%c(%2i)",EarthMagneticInclination, HoTT_GRAD,EarthMagneticInclinationTheoretic); |
476 | } |
519 | } |
477 | else |
520 | else |
478 | { |
521 | { |
479 | HoTT_printfxy(0,5," %2um/s: HM:%3d%c %c",GPSInfo.Speed, GPSInfo.HomeBearing, HoTT_GRAD, NC_GPS_ModeCharacter); |
522 | HoTT_printfxy(0,5," %2um/s: HM:%3d%c %c",GPSInfo.Speed, GPSInfo.HomeBearing, HoTT_GRAD, NC_GPS_ModeCharacter); |
480 | } |
523 | } |
481 | } |
524 | } |
482 | else Hott_ClearLine(5); |
525 | else Hott_ClearLine(5); |
483 | break; |
526 | break; |
484 | case 6: |
527 | case 6: |
485 | break; |
528 | break; |
486 | case 7: if(NC_ErrorCode) |
529 | case 7: if(NC_ErrorCode) |
487 | { |
530 | { |
488 | if(HoTTBlink && NC_ErrorCode < MAX_ERR_NUMBER) |
531 | if(HoTTBlink && NC_ErrorCode < MAX_ERR_NUMBER) |
489 | { |
532 | { |
490 | Hott_ClearLine(7); |
533 | Hott_ClearLine(7); |
491 | HoTT_printfxy_INV(0,7,"ERR: %2d !",NC_ErrorCode); |
534 | HoTT_printfxy_INV(0,7,"ERR: %2d !",NC_ErrorCode); |
492 | } |
535 | } |
493 | else |
536 | else |
494 | { |
537 | { |
495 | HoTT_printfxy(0,7,"ERR: "); _printf_P(&LIBFC_HoTT_Putchar, NC_ERROR_TEXT[NC_ErrorCode] , 0);}; |
538 | HoTT_printfxy(0,7,"ERR: "); _printf_P(&LIBFC_HoTT_Putchar, NC_ERROR_TEXT[NC_ErrorCode] , 0);}; |
496 | } |
539 | } |
497 | else |
540 | else |
498 | if(FC_StatusFlags & FC_STATUS_LOWBAT) HoTT_printfxy(1,7,"!! LiPo voltage !!") |
541 | if(FC_StatusFlags & FC_STATUS_LOWBAT) HoTT_printfxy(1,7,"!! LiPo voltage !!") |
499 | else HoTT_printfxy(0,7," www.MikroKopter.de "); |
542 | else HoTT_printfxy(0,7," www.MikroKopter.de "); |
500 | break; |
543 | break; |
501 | case 8: //ASCIIPacket.WarnBeep = HoTT_Waring(); |
544 | case 8: //ASCIIPacket.WarnBeep = HoTT_Waring(); |
502 | // ASCIIPacket.WarnBeep = Parameter_UserParam1; |
545 | // ASCIIPacket.WarnBeep = Parameter_UserParam1; |
503 | case 9: |
546 | case 9: |
504 | case 10: |
547 | case 10: |
505 | case 11: |
548 | case 11: |
506 | case 12: |
549 | case 12: |
507 | case 13: |
550 | case 13: |
508 | case 14: |
551 | case 14: |
509 | case 15: |
552 | case 15: |
510 | case 16: |
553 | case 16: |
511 | if(HottKeyboard == HOTT_KEY_SET) { if(show_mag) show_mag = 0; else show_mag = 1;} |
554 | if(HottKeyboard == HOTT_KEY_SET) { if(show_mag) show_mag = 0; else show_mag = 1;} |
512 | else |
555 | else |
513 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page = 1; line = 0;}; |
556 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page = 1; line = 0;}; |
514 | HottKeyboard = 0; |
557 | HottKeyboard = 0; |
515 | break; |
558 | break; |
516 | default: line = 0; |
559 | default: line = 0; |
517 | break; |
560 | break; |
518 | } |
561 | } |
519 | else |
562 | else |
520 | if(page == 1) |
563 | if(page == 1) |
521 | switch(line++) |
564 | switch(line++) |
522 | { |
565 | { |
523 | case 0: |
566 | case 0: |
524 | if(FC_StatusFlags & FC_STATUS_LOWBAT) |
567 | if(FC_StatusFlags & FC_STATUS_LOWBAT) |
525 | HoTT_printfxy_BLINK(0,0," %2i:%02i %2i.%1iV %4imAh",FlugSekunden/60,FlugSekunden%60,UBat/10, UBat%10,Capacity.UsedCapacity) |
568 | HoTT_printfxy_BLINK(0,0," %2i:%02i %2i.%1iV %4imAh",FlugSekunden/60,FlugSekunden%60,UBat/10, UBat%10,Capacity.UsedCapacity) |
526 | else HoTT_printfxy(0,0," %2i:%02i %2i.%1iV %4imAh",FlugSekunden/60,FlugSekunden%60,UBat/10, UBat%10,Capacity.UsedCapacity); |
569 | else HoTT_printfxy(0,0," %2i:%02i %2i.%1iV %4imAh",FlugSekunden/60,FlugSekunden%60,UBat/10, UBat%10,Capacity.UsedCapacity); |
527 | break; |
570 | break; |
528 | case 1: |
571 | case 1: |
529 | HoTT_printfxy(0,1,"DIR:%3d%c",KompassValue, HoTT_GRAD); |
572 | HoTT_printfxy(0,1,"DIR:%3d%c",KompassValue, HoTT_GRAD); |
530 | if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG) |
573 | if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG) |
531 | { |
574 | { |
532 | if(HoehenReglerAktiv) HoTT_printfxy_INV(10,1,"ALT:%4im", (int16_t)(HoehenWert/100)) |
575 | if(HoehenReglerAktiv) HoTT_printfxy_INV(10,1,"ALT:%4im", (int16_t)(HoehenWert/100)) |
533 | else HoTT_printfxy(10,1,"ALT:%4im", (int16_t)(HoehenWert/100)) |
576 | else HoTT_printfxy(10,1,"ALT:%4im", (int16_t)(HoehenWert/100)) |
534 | } |
577 | } |
535 | else HoTT_printfxy(10,1,"ALT:---- "); |
578 | else HoTT_printfxy(10,1,"ALT:---- "); |
536 | HoTT_printfxy(20,1,"%c",VarioCharacter); |
579 | HoTT_printfxy(20,1,"%c",VarioCharacter); |
537 | break; |
580 | break; |
538 | case 2: |
581 | case 2: |
539 | if(NaviDataOkay) |
582 | if(NaviDataOkay) |
540 | { |
583 | { |
541 | HoTT_printfxy(1,2,"HM:%3d%c DIST:%3dm %c", GPSInfo.HomeBearing, HoTT_GRAD, GPSInfo.HomeDistance/10, NC_GPS_ModeCharacter); |
584 | HoTT_printfxy(1,2,"HM:%3d%c DIST:%3dm %c", GPSInfo.HomeBearing, HoTT_GRAD, GPSInfo.HomeDistance/10, NC_GPS_ModeCharacter); |
542 | } |
585 | } |
543 | else |
586 | else |
544 | { |
587 | { |
545 | Hott_ClearLine(2); |
588 | Hott_ClearLine(2); |
546 | } |
589 | } |
547 | break; |
590 | break; |
548 | case 3: |
591 | case 3: |
549 | HoTT_printfxy(0,3,"PWR:%2i.%1iA (%iW) ",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10,Capacity.ActualPower); |
592 | HoTT_printfxy(0,3,"PWR:%2i.%1iA (%iW) ",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10,Capacity.ActualPower); |
550 | if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) HoTT_printfxy_INV(19,3,"CF") else HoTT_printfxy(19,3," "); |
593 | if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) HoTT_printfxy_INV(19,3,"CF") else HoTT_printfxy(19,3," "); |
551 | break; |
594 | break; |
552 | case 4: |
595 | case 4: |
553 | if(NaviDataOkay) |
596 | if(NaviDataOkay) |
554 | { |
597 | { |
555 | HoTT_printfxy(0,4,"GPS:%2um/s SAT:%d ",GPSInfo.Speed,GPSInfo.NumOfSats); |
598 | HoTT_printfxy(0,4,"GPS:%2um/s SAT:%d ",GPSInfo.Speed,GPSInfo.NumOfSats); |
556 | switch (GPSInfo.SatFix) |
599 | switch (GPSInfo.SatFix) |
557 | { |
600 | { |
558 | case SATFIX_3D: |
601 | case SATFIX_3D: |
559 | HoTT_printfxy(16,4," 3D "); |
602 | HoTT_printfxy(16,4," 3D "); |
560 | break; |
603 | break; |
561 | //case SATFIX_2D: |
604 | //case SATFIX_2D: |
562 | //case SATFIX_NONE: |
605 | //case SATFIX_NONE: |
563 | default: |
606 | default: |
564 | HoTT_printfxy_BLINK(16,4,"NOFIX"); |
607 | HoTT_printfxy_BLINK(16,4,"NOFIX"); |
565 | break; |
608 | break; |
566 | } |
609 | } |
567 | if(GPSInfo.Flags & FLAG_DIFFSOLN) |
610 | if(GPSInfo.Flags & FLAG_DIFFSOLN) |
568 | { |
611 | { |
569 | HoTT_printfxy(16,4,"DGPS "); |
612 | HoTT_printfxy(16,4,"DGPS "); |
570 | } |
613 | } |
571 | } |
614 | } |
572 | else |
615 | else |
573 | { //012345678901234567890 |
616 | { //012345678901234567890 |
574 | HoTT_printfxy(0,4," No NaviCtrl "); |
617 | HoTT_printfxy(0,4," No NaviCtrl "); |
575 | } |
618 | } |
576 | break; |
619 | break; |
577 | case 5: |
620 | case 5: |
578 | if(show_current) |
621 | if(show_current) |
579 | { |
622 | { |
580 | 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); |
623 | 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); |
581 | } |
624 | } |
582 | else |
625 | else |
583 | { |
626 | { |
584 | HoTT_printfxy(0,5,"%3i %3i %3i %3i%cC", Motor[0].Temperature, Motor[1].Temperature, Motor[2].Temperature, Motor[3].Temperature,HoTT_GRAD); |
627 | HoTT_printfxy(0,5,"%3i %3i %3i %3i%cC", Motor[0].Temperature, Motor[1].Temperature, Motor[2].Temperature, Motor[3].Temperature,HoTT_GRAD); |
585 | } |
628 | } |
586 | break; |
629 | break; |
587 | case 6: |
630 | case 6: |
588 | if(show_current) |
631 | if(show_current) |
589 | { |
632 | { |
590 | if(RequiredMotors == 4) Hott_ClearLine(6); |
633 | if(RequiredMotors == 4) Hott_ClearLine(6); |
591 | else |
634 | else |
592 | 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) |
635 | 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) |
593 | else |
636 | else |
594 | 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); |
637 | 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); |
595 | } |
638 | } |
596 | else |
639 | else |
597 | { |
640 | { |
598 | if(RequiredMotors == 4) Hott_ClearLine(6); |
641 | if(RequiredMotors == 4) Hott_ClearLine(6); |
599 | else |
642 | else |
600 | if(RequiredMotors == 6) HoTT_printfxy(0,6,"%3i %3i%cC ", Motor[4].Temperature, Motor[5].Temperature,HoTT_GRAD) |
643 | if(RequiredMotors == 6) HoTT_printfxy(0,6,"%3i %3i%cC ", Motor[4].Temperature, Motor[5].Temperature,HoTT_GRAD) |
601 | else |
644 | else |
602 | 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); |
645 | 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); |
603 | } |
646 | } |
604 | break; |
647 | break; |
605 | case 7: if(NC_ErrorCode) |
648 | case 7: if(NC_ErrorCode) |
606 | { |
649 | { |
607 | if(HoTTBlink && NC_ErrorCode < MAX_ERR_NUMBER) |
650 | if(HoTTBlink && NC_ErrorCode < MAX_ERR_NUMBER) |
608 | { |
651 | { |
609 | Hott_ClearLine(7); |
652 | Hott_ClearLine(7); |
610 | HoTT_printfxy_INV(0,7,"ERR: %2d !",NC_ErrorCode); |
653 | HoTT_printfxy_INV(0,7,"ERR: %2d !",NC_ErrorCode); |
611 | } |
654 | } |
612 | else |
655 | else |
613 | { |
656 | { |
614 | HoTT_printfxy(0,7,"ERR: "); _printf_P(&LIBFC_HoTT_Putchar, NC_ERROR_TEXT[NC_ErrorCode] , 0);}; |
657 | HoTT_printfxy(0,7,"ERR: "); _printf_P(&LIBFC_HoTT_Putchar, NC_ERROR_TEXT[NC_ErrorCode] , 0);}; |
615 | } |
658 | } |
616 | else |
659 | else |
617 | if(FC_StatusFlags & FC_STATUS_LOWBAT) HoTT_printfxy(1,7,"!! LiPo voltage !!") |
660 | if(FC_StatusFlags & FC_STATUS_LOWBAT) HoTT_printfxy(1,7,"!! LiPo voltage !!") |
618 | else HoTT_printfxy(0,7," www.MikroKopter.de "); |
661 | else HoTT_printfxy(0,7," www.MikroKopter.de "); |
619 | break; |
662 | break; |
620 | case 8: // ASCIIPacket.WarnBeep = HoTT_Waring(); |
663 | case 8: // ASCIIPacket.WarnBeep = HoTT_Waring(); |
621 | // ASCIIPacket.WarnBeep = Parameter_UserParam1; |
664 | // ASCIIPacket.WarnBeep = Parameter_UserParam1; |
622 | case 9: |
665 | case 9: |
623 | case 10: |
666 | case 10: |
624 | case 11: |
667 | case 11: |
625 | case 12: |
668 | case 12: |
626 | case 13: |
669 | case 13: |
627 | case 14: |
670 | case 14: |
628 | case 15: |
671 | case 15: |
629 | case 16: |
672 | case 16: |
630 | if(HottKeyboard == HOTT_KEY_SET) { if(show_current) show_current = 0; else show_current = 1; Hott_ClearLine(5); Hott_ClearLine(6);} |
673 | if(HottKeyboard == HOTT_KEY_SET) { if(show_current) show_current = 0; else show_current = 1; Hott_ClearLine(5); Hott_ClearLine(6);} |
631 | else |
674 | else |
632 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page = 2; line = 0;} |
675 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page = 2; line = 0;} |
633 | else |
676 | else |
634 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page = 0; line = 0;} |
677 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page = 0; line = 0;} |
635 | //if(HottKeyboard) HoTT_printfxy(15,6,"%KEY:%02x ",HottKeyboard); |
678 | //if(HottKeyboard) HoTT_printfxy(15,6,"%KEY:%02x ",HottKeyboard); |
636 | HottKeyboard = 0; |
679 | HottKeyboard = 0; |
637 | break; |
680 | break; |
638 | default: line = 0; |
681 | default: line = 0; |
639 | break; |
682 | break; |
640 | } |
683 | } |
641 | else |
684 | else |
642 | if(page == 2) |
685 | if(page == 2) |
643 | switch(line++) |
686 | switch(line++) |
644 | { |
687 | { |
645 | case 0: |
688 | case 0: |
646 | HoTT_printfxy_INV(0,0,"Setting:%u %s ",GetActiveParamSet(),EE_Parameter.Name); |
689 | HoTT_printfxy_INV(0,0,"Setting:%u %s ",GetActiveParamSet(),EE_Parameter.Name); |
647 | break; |
690 | break; |
648 | case 1: HoTT_printfxy(0,1,"Min:%2i.%1iV %s ",BattLowVoltageWarning/10, BattLowVoltageWarning%10, Mixer.Name); |
691 | case 1: HoTT_printfxy(0,1,"Min:%2i.%1iV %s ",BattLowVoltageWarning/10, BattLowVoltageWarning%10, Mixer.Name); |
649 | break; |
692 | break; |
650 | case 2: HoTT_printfxy(0,2,"ALT:"); |
693 | case 2: HoTT_printfxy(0,2,"ALT:"); |
651 | if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG) |
694 | if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG) |
652 | { |
695 | { |
653 | if(!(EE_Parameter.GlobalConfig & CFG_HOEHEN_SCHALTER)) HoTT_printf("POTI:%3u ", Parameter_HoehenSchalter) |
696 | if(!(EE_Parameter.GlobalConfig & CFG_HOEHEN_SCHALTER)) HoTT_printf("POTI:%3u ", Parameter_HoehenSchalter) |
654 | else |
697 | else |
655 | { |
698 | { |
656 | if(Parameter_HoehenSchalter > 50) HoTT_printf("(ON) ") else HoTT_printf("(OFF) "); |
699 | if(Parameter_HoehenSchalter > 50) HoTT_printf("(ON) ") else HoTT_printf("(OFF) "); |
657 | if((Parameter_ExtraConfig & CFG2_HEIGHT_LIMIT)) HoTT_printf("LIMIT", Parameter_HoehenSchalter) |
700 | if((Parameter_ExtraConfig & CFG2_HEIGHT_LIMIT)) HoTT_printf("LIMIT", Parameter_HoehenSchalter) |
658 | else HoTT_printf("VARIO", Parameter_HoehenSchalter); |
701 | else HoTT_printf("VARIO", Parameter_HoehenSchalter); |
659 | } |
702 | } |
660 | } |
703 | } |
661 | else |
704 | else |
662 | HoTT_printf("DISABLED"); |
705 | HoTT_printf("DISABLED"); |
663 | break; |
706 | break; |
664 | case 3: HoTT_printfxy(0,3,"CF:"); |
707 | case 3: HoTT_printfxy(0,3,"CF:"); |
665 | if(!EE_Parameter.CareFreeModeControl) HoTT_printf("DISABLED") |
708 | if(!EE_Parameter.CareFreeModeControl) HoTT_printf("DISABLED") |
666 | else |
709 | else |
667 | { |
710 | { |
668 | if(CareFree) HoTT_printf(" (ON) ") else HoTT_printf(" (OFF)"); |
711 | if(CareFree) HoTT_printf(" (ON) ") else HoTT_printf(" (OFF)"); |
669 | if(EE_Parameter.ExtraConfig & CFG_LEARNABLE_CAREFREE) HoTT_printf(" TEACH"); |
712 | if(EE_Parameter.ExtraConfig & CFG_LEARNABLE_CAREFREE) HoTT_printf(" TEACH"); |
670 | } |
713 | } |
671 | break; |
714 | break; |
672 | case 4: HoTT_printfxy(0,4,"GPS:"); |
715 | case 4: HoTT_printfxy(0,4,"GPS:"); |
673 | if(!(Parameter_GlobalConfig & CFG_GPS_AKTIV)) HoTT_printf("DISABLED") |
716 | if(!(Parameter_GlobalConfig & CFG_GPS_AKTIV)) HoTT_printf("DISABLED") |
674 | else |
717 | else |
675 | { |
718 | { |
676 | CHK_POTI(tmp,EE_Parameter.NaviGpsModeControl); |
719 | CHK_POTI(tmp,EE_Parameter.NaviGpsModeControl); |
677 | if(tmp < 50) HoTT_printf("(FREE)") |
720 | if(tmp < 50) HoTT_printf("(FREE)") |
678 | else |
721 | else |
679 | if(tmp >= 180) HoTT_printf("(HOME)") |
722 | if(tmp >= 180) HoTT_printf("(HOME)") |
680 | else |
723 | else |
681 | if(EE_Parameter.ExtraConfig & CFG_GPS_AID) HoTT_printf("(AID) ") |
724 | if(EE_Parameter.ExtraConfig & CFG_GPS_AID) HoTT_printf("(AID) ") |
682 | else HoTT_printf("(HOLD)") |
725 | else HoTT_printf("(HOLD)") |
683 | } |
726 | } |
684 | if(EE_Parameter.FailSafeTime) HoTT_printfxy(10,4," FS:%usek ",EE_Parameter.FailSafeTime) |
727 | if(EE_Parameter.FailSafeTime) HoTT_printfxy(10,4," FS:%usek ",EE_Parameter.FailSafeTime) |
685 | 728 | ||
686 | break; |
729 | break; |
687 | case 5: HoTT_printfxy(0,5,"HOME ALT:"); |
730 | case 5: HoTT_printfxy(0,5,"HOME ALT:"); |
688 | if(EE_Parameter.ComingHomeAltitude) HoTT_printf("%um",EE_Parameter.ComingHomeAltitude) else HoTT_printf("HOLD "); |
731 | if(EE_Parameter.ComingHomeAltitude) HoTT_printf("%um",EE_Parameter.ComingHomeAltitude) else HoTT_printf("HOLD "); |
689 | break; |
732 | break; |
690 | case 6: |
733 | case 6: |
691 | if(!show_poti) |
734 | if(!show_poti) |
692 | { |
735 | { |
693 | 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); |
736 | 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); |
694 | HoTT_printfxy(0,7,"Gs:%4i Ya:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_GAS]]+127,PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]); |
737 | HoTT_printfxy(0,7,"Gs:%4i Ya:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_GAS]]+127,PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]); |
695 | } |
738 | } |
696 | else |
739 | else |
697 | { |
740 | { |
698 | HoTT_printfxy(0,6,"P1:%4i P2:%4i 3:%3i",Poti1,Poti2, Poti3); |
741 | HoTT_printfxy(0,6,"P1:%4i P2:%4i 3:%3i",Poti1,Poti2, Poti3); |
699 | HoTT_printfxy(0,7,"P4:%4i P5:%4i 6:%3i",Poti4,Poti5, Poti6); |
742 | HoTT_printfxy(0,7,"P4:%4i P5:%4i 6:%3i",Poti4,Poti5, Poti6); |
700 | } |
743 | } |
701 | 744 | ||
702 | break; |
745 | break; |
703 | case 7: //HoTT_printfxy(0,6,"WARNINGS:"); |
746 | case 7: //HoTT_printfxy(0,6,"WARNINGS:"); |
704 | if(HoTTBlink) |
747 | if(HoTTBlink) |
705 | { |
748 | { |
706 | LIBFC_HoTT_SetPos(6 * 21); |
749 | LIBFC_HoTT_SetPos(6 * 21); |
707 | if(!(Parameter_GlobalConfig & CFG_ACHSENKOPPLUNG_AKTIV)) HoTT_printf_BLINK("COUPLING OFF! "); |
750 | if(!(Parameter_GlobalConfig & CFG_ACHSENKOPPLUNG_AKTIV)) HoTT_printf_BLINK("COUPLING OFF! "); |
708 | if(EE_Parameter.BitConfig & (CFG_LOOP_LINKS | CFG_LOOP_RECHTS | CFG_LOOP_UNTEN | CFG_LOOP_OBEN)) HoTT_printf_BLINK("LOOPING! "); |
751 | if(EE_Parameter.BitConfig & (CFG_LOOP_LINKS | CFG_LOOP_RECHTS | CFG_LOOP_UNTEN | CFG_LOOP_OBEN)) HoTT_printf_BLINK("LOOPING! "); |
709 | if(Parameter_GlobalConfig & CFG_HEADING_HOLD) HoTT_printf_BLINK("HH! "); |
752 | if(Parameter_GlobalConfig & CFG_HEADING_HOLD) HoTT_printf_BLINK("HH! "); |
710 | if(!(Parameter_GlobalConfig & CFG_KOMPASS_AKTIV)) HoTT_printf_BLINK("COMPASS OFF! "); |
753 | if(!(Parameter_GlobalConfig & CFG_KOMPASS_AKTIV)) HoTT_printf_BLINK("COMPASS OFF! "); |
711 | } |
754 | } |
712 | break; |
755 | break; |
713 | case 8: //ASCIIPacket.WarnBeep = HoTT_Waring(); |
756 | case 8: //ASCIIPacket.WarnBeep = HoTT_Waring(); |
714 | break; |
757 | break; |
715 | case 9: |
758 | case 9: |
716 | case 10: |
759 | case 10: |
717 | case 11: |
760 | case 11: |
718 | case 12: |
761 | case 12: |
719 | case 13: |
762 | case 13: |
720 | case 14: |
763 | case 14: |
721 | case 15: |
764 | case 15: |
722 | case 16: |
765 | case 16: |
723 | if(HottKeyboard == HOTT_KEY_SET) { if(show_poti) show_poti = 0; else show_poti = 1; Hott_ClearLine(6); Hott_ClearLine(7);} |
766 | if(HottKeyboard == HOTT_KEY_SET) { if(show_poti) show_poti = 0; else show_poti = 1; Hott_ClearLine(6); Hott_ClearLine(7);} |
724 | else |
767 | else |
725 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page = 3; line = 0;} |
768 | if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page = 3; line = 0;} |
726 | else |
769 | else |
727 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page = 1; line = 0;}; |
770 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page = 1; line = 0;}; |
728 | HottKeyboard = 0; |
771 | HottKeyboard = 0; |
729 | break; |
772 | break; |
730 | default: line = 0; |
773 | default: line = 0; |
731 | break; |
774 | break; |
732 | } |
775 | } |
733 | else |
776 | else |
734 | if(page == 3) |
777 | if(page == 3) |
735 | switch(line++) |
778 | switch(line++) |
736 | { |
779 | { |
737 | case 0: |
780 | case 0: |
738 | HoTT_printfxy(0,2,"Speak:"); |
781 | HoTT_printfxy(0,2,"Speak:"); |
739 | break; |
782 | break; |
740 | case 1: |
783 | case 1: |
741 | if(GetParamByte(PID_SPEAK_HOTT_CFG) & 0x01) HoTT_printfxy_INV(7,2,"All Messages ") |
784 | if(GetParamByte(PID_SPEAK_HOTT_CFG) & 0x01) HoTT_printfxy_INV(7,2,"All Messages ") |
742 | else HoTT_printfxy_INV(7,2,"Warnings only"); |
785 | else HoTT_printfxy_INV(7,2,"Warnings only"); |
743 | break; |
786 | break; |
744 | case 2: |
787 | case 2: |
745 | HoTT_printfxy(1,4,"Use (set) to select"); |
788 | HoTT_printfxy(1,4,"Use (set) to select"); |
746 | break; |
789 | break; |
747 | default: |
790 | default: |
748 | if(HottKeyboard == HOTT_KEY_SET) |
791 | if(HottKeyboard == HOTT_KEY_SET) |
749 | { |
792 | { |
750 | SetParamByte(PID_SPEAK_HOTT_CFG, GetParamByte(PID_SPEAK_HOTT_CFG) ^ 0x01); |
793 | SetParamByte(PID_SPEAK_HOTT_CFG, GetParamByte(PID_SPEAK_HOTT_CFG) ^ 0x01); |
751 | } |
794 | } |
752 | else |
795 | else |
753 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page = 2; line = 0;}; |
796 | if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page = 2; line = 0;}; |
754 | HottKeyboard = 0; |
797 | HottKeyboard = 0; |
755 | line = 0; |
798 | line = 0; |
756 | break; |
799 | break; |
757 | } |
800 | } |
758 | else page = 0; |
801 | else page = 0; |
759 | } |
802 | } |
760 | 803 | ||
761 | #endif |
804 | #endif |
762 | 805 | ||
763 | 806 | ||
764 | 807 | ||
765 | 808 |