Subversion Repositories FlightCtrl

Rev

Rev 2090 | Rev 2120 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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