Subversion Repositories FlightCtrl

Rev

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

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