Subversion Repositories FlightCtrl

Rev

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

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