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