Subversion Repositories FlightCtrl

Rev

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

Rev 2440 Rev 2475
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
unsigned char NaviData_WaypointIndex = 0;
59
unsigned char NaviData_WaypointIndex = 0;
60
unsigned char NaviData_WaypointNumber = 0, NaviData_TargetHoldTime = 0, ToNC_Load_WP_List = 0, NaviData_MaxWpListIndex = 0;
60
unsigned char NaviData_WaypointNumber = 0, NaviData_TargetHoldTime = 0, ToNC_Load_WP_List = 0, NaviData_MaxWpListIndex = 0;
61
unsigned char ToNC_Load_SingePoint = 0, ToNC_Store_SingePoint = 0;
61
unsigned char ToNC_Load_SingePoint = 0, ToNC_Store_SingePoint = 0;
62
char WPL_Name[10];// = {"         \0"};
62
char WPL_Name[10];// = {"         \0"};
63
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))
63
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))
64
 
64
 
65
#define HoTT_printf(format, args...)                    {  _printf_P(&LIBFC_HoTT_Putchar, PSTR(format) , ## args);}
65
#define HoTT_printf(format, args...)                    {  _printf_P(&LIBFC_HoTT_Putchar, PSTR(format) , ## args);}
66
#define HoTT_printfxy(x,y,format, args...)              { LIBFC_HoTT_SetPos(y * 21 + x); _printf_P(&LIBFC_HoTT_Putchar, PSTR(format) , ## args);}
66
#define HoTT_printfxy(x,y,format, args...)              { LIBFC_HoTT_SetPos(y * 21 + x); _printf_P(&LIBFC_HoTT_Putchar, PSTR(format) , ## args);}
67
#define HoTT_printfxy_INV(x,y,format, args...)          { LIBFC_HoTT_SetPos(y * 21 + x); _printf_P(&LIBFC_HoTT_Putchar_INV, PSTR(format) , ## args);}
67
#define HoTT_printfxy_INV(x,y,format, args...)          { LIBFC_HoTT_SetPos(y * 21 + x); _printf_P(&LIBFC_HoTT_Putchar_INV, PSTR(format) , ## args);}
68
#define HoTT_printfxy_BLINK(x,y,format, args...)        { LIBFC_HoTT_SetPos(y * 21 + x); _printf_P(&LIBFC_HoTT_Putchar_BLINK, PSTR(format) , ## args);}
68
#define HoTT_printfxy_BLINK(x,y,format, args...)        { LIBFC_HoTT_SetPos(y * 21 + x); _printf_P(&LIBFC_HoTT_Putchar_BLINK, PSTR(format) , ## args);}
69
#define HoTT_printf_BLINK(format, args...)              { _printf_P(&LIBFC_HoTT_Putchar_BLINK, PSTR(format) , ## args);}
69
#define HoTT_printf_BLINK(format, args...)              { _printf_P(&LIBFC_HoTT_Putchar_BLINK, PSTR(format) , ## args);}
70
#define HoTT_printf_INV(format, args...)                        { _printf_P(&LIBFC_HoTT_Putchar_INV, PSTR(format) , ## args);}
70
#define HoTT_printf_INV(format, args...)                        { _printf_P(&LIBFC_HoTT_Putchar_INV, PSTR(format) , ## args);}
71
 
71
 
72
#define VOICE_MINIMALE_EINGANSSPANNUNG    16
72
#define VOICE_MINIMALE_EINGANSSPANNUNG    16
73
#define VOICE_BEEP                         5
73
#define VOICE_BEEP                         5
74
#define HoTT_GRAD       96
74
#define HoTT_GRAD       96
75
#define HoTT_LINKS      123
75
#define HoTT_LINKS      123
76
#define HoTT_RECHTS 124
76
#define HoTT_RECHTS 124
77
#define HoTT_OBEN       125
77
#define HoTT_OBEN       125
78
#define HoTT_UNTEN      126
78
#define HoTT_UNTEN      126
79
 
79
 
80
#define HOTT_KEY_RIGHT  1
80
#define HOTT_KEY_RIGHT  1
81
#define HOTT_KEY_DOWN   2
81
#define HOTT_KEY_DOWN   2
82
#define HOTT_KEY_UP     4
82
#define HOTT_KEY_UP     4
83
#define HOTT_KEY_SET    6
83
#define HOTT_KEY_SET    6
84
#define HOTT_KEY_LEFT   8
84
#define HOTT_KEY_LEFT   8
85
 
85
 
86
#define VARIO_ZERO 30000
86
#define VARIO_ZERO 30000
87
unsigned int NaviData_TargetDistance = 0;
87
unsigned int NaviData_TargetDistance = 0;
88
 
88
 
89
unsigned char MaxBlTemperture = 0;
89
unsigned char MaxBlTemperture = 0;
90
unsigned char MinBlTemperture = 0;
90
unsigned char MinBlTemperture = 0;
91
unsigned char HottestBl = 0;
91
unsigned char HottestBl = 0;
92
 
92
 
93
GPSPacket_t GPSPacket;
93
GPSPacket_t GPSPacket;
94
VarioPacket_t VarioPacket;
94
VarioPacket_t VarioPacket;
95
ASCIIPacket_t ASCIIPacket;
95
ASCIIPacket_t ASCIIPacket;
96
ElectricAirPacket_t ElectricAirPacket;
96
ElectricAirPacket_t ElectricAirPacket;
97
HoTTGeneral_t HoTTGeneral;
97
HoTTGeneral_t HoTTGeneral;
98
unsigned char SpeakHoTT = SPEAK_MIKROKOPTER;
98
unsigned char SpeakHoTT = SPEAK_MIKROKOPTER;
99
unsigned char ToNC_SpeakHoTT = 0, ShowSettingNameTime = 0;
99
unsigned char ToNC_SpeakHoTT = 0, ShowSettingNameTime = 0;
100
int HoTTVarioMeter = 0;
100
int HoTTVarioMeter = 0;
101
const char PROGMEM MIKROKOPTER[] =      {"     MikroKopter     "};
101
const char PROGMEM MIKROKOPTER[] =      {"     MikroKopter     "};
102
const char PROGMEM UNDERVOLTAGE[] =     {" !! LiPo voltage !!  "};
102
const char PROGMEM UNDERVOLTAGE[] =     {" !! LiPo voltage !!  "};
103
const char PROGMEM LANDING[] =      {" !!   LANDING    !!  "};
103
const char PROGMEM LANDING[] =      {" !!   LANDING    !!  "};
-
 
104
const char PROGMEM SIMULATION[] =       {"  SIMULATION active  "};
-
 
105
const char PROGMEM BOAT_MODE[] =        {" MikroKopter (Boat)  "};
104
const char PROGMEM SETTING[] =  {"Set  :"};
106
const char PROGMEM SETTING[] =  {"Set  :"};
105
const char PROGMEM NC_ERROR_TEXT[MAX_ERR_NUMBER][17] =
107
const char PROGMEM NC_ERROR_TEXT[MAX_ERR_NUMBER][17] =
106
{
108
{
107
//0123456789123456
109
//0123456789123456
108
 "No Error        \0",  // 0
110
 "No Error        \0",  // 0
109
 "Not compatible  \0",  // 1
111
 "Not compatible  \0",  // 1
110
 "MK3Mag not compa\0",  // 2
112
 "MK3Mag not compa\0",  // 2
111
 "No FC communicat\0",  // 3
113
 "No FC communicat\0",  // 3
112
 "Compass communic\0",  // 4
114
 "Compass communic\0",  // 4
113
 "GPS communicatio\0",  // 5
115
 "GPS communicatio\0",  // 5
114
 "compass value   \0",  // 6
116
 "compass value   \0",  // 6
115
 "RC Signal lost  \0",  // 7
117
 "RC Signal lost  \0",  // 7
116
 "FC spi rx error \0",  // 8
118
 "FC spi rx error \0",  // 8
117
 "No NC communicat\0",  // 9
119
 "No NC communicat\0",  // 9
118
 "FC Nick Gyro    \0",  // 10
120
 "FC Nick Gyro    \0",  // 10
119
 "FC Roll Gyro    \0",  // 11
121
 "FC Roll Gyro    \0",  // 11
120
 "FC Yaw Gyro     \0",  // 12
122
 "FC Yaw Gyro     \0",  // 12
121
 "FC Nick ACC     \0",  // 13
123
 "FC Nick ACC     \0",  // 13
122
 "FC Roll ACC     \0",  // 14
124
 "FC Roll ACC     \0",  // 14
123
 "FC Z-ACC        \0",  // 15
125
 "FC Z-ACC        \0",  // 15
124
 "Pressure sensor \0",  // 16
126
 "Pressure sensor \0",  // 16
125
 "I2C FC->BL-Ctrl \0",  // 17
127
 "I2C FC->BL-Ctrl \0",  // 17
126
 "Bl Missing      \0",  // 18
128
 "Bl Missing      \0",  // 18
127
 "Mixer Error     \0",  // 19
129
 "Mixer Error     \0",  // 19
128
 "Carefree Error  \0",  // 20
130
 "Carefree Error  \0",  // 20
129
 "GPS Fix lost    \0",  // 21
131
 "GPS Fix lost    \0",  // 21
130
 "Magnet Error    \0",  // 22
132
 "Magnet Error    \0",  // 22
131
 "Motor restart   \0",  // 23
133
 "Motor restart   \0",  // 23
132
 "BL Limitation   \0",  // 24
134
 "BL Limitation   \0",  // 24
133
 "GPS Range       \0",  // 25
135
 "GPS Range       \0",  // 25
134
 "No SD-Card      \0",  // 26
136
 "No SD-Card      \0",  // 26
135
 "SD-Logging error\0",  // 27
137
 "SD-Logging error\0",  // 27
136
 "Flying range!   \0",  // 28
138
 "Flying range!   \0",  // 28
137
 "Max Altitude!   \0",  // 29
139
 "Max Altitude!   \0",  // 29
138
 "No GPS fix      \0",  // 30
140
 "No GPS fix      \0",  // 30
139
 "compass not cal.\0",  // 31
141
 "compass not cal.\0",  // 31
140
 "BL-Selftest     \0",  // 32
142
 "BL-Selftest     \0",  // 32
141
 "no ext. compass \0",  // 33
143
 "no ext. compass \0",  // 33
142
 "compass sensor  \0"   // 34
144
 "compass sensor  \0"   // 34
143
};
145
};
144
 
146
 
145
 
147
 
146
const char PROGMEM HOTT_ERROR[MAX_ERR_NUMBER][2] =
148
const char PROGMEM HOTT_ERROR[MAX_ERR_NUMBER][2] =
147
{       // 1 -> only in flight   0 -> also on ground
149
{       // 1 -> only in flight   0 -> also on ground
148
//0123456789123456
150
//0123456789123456
149
         {0,0},// "No Error        \0",  // 0
151
         {0,0},// "No Error        \0",  // 0
150
         {SPEAK_ERROR,0},               // "Not compatible  \0",  // 1
152
         {SPEAK_ERROR,0},               // "Not compatible  \0",  // 1
151
         {SPEAK_ERROR,0},               // "MK3Mag not compa\0",  // 2
153
         {SPEAK_ERROR,0},               // "MK3Mag not compa\0",  // 2
152
         {SPEAK_ERR_NAVI,1},    // "No FC communicat\0",  // 3
154
         {SPEAK_ERR_NAVI,1},    // "No FC communicat\0",  // 3
153
         {SPEAK_ERR_COMPASS,1}, // "MK3Mag communica\0",  // 4
155
         {SPEAK_ERR_COMPASS,1}, // "MK3Mag communica\0",  // 4
154
         {SPEAK_ERR_GPS,0},             // "GPS communicatio\0",  // 5
156
         {SPEAK_ERR_GPS,0},             // "GPS communicatio\0",  // 5
155
         {SPEAK_ERR_COMPASS,1}, // "compass value   \0",  // 6
157
         {SPEAK_ERR_COMPASS,1}, // "compass value   \0",  // 6
156
         {SPEAK_ERR_RECEICER,0},// "RC Signal lost  \0",  // 7
158
         {SPEAK_ERR_RECEICER,0},// "RC Signal lost  \0",  // 7
157
         {SPEAK_ERR_NAVI,0},    // "FC spi rx error \0",  // 8
159
         {SPEAK_ERR_NAVI,0},    // "FC spi rx error \0",  // 8
158
         {SPEAK_ERR_NAVI,0},    // "No NC communicat\0",  // 9
160
         {SPEAK_ERR_NAVI,0},    // "No NC communicat\0",  // 9
159
         {SPEAK_ERR_SENSOR,0},  // "FC Nick Gyro    \0",  // 10
161
         {SPEAK_ERR_SENSOR,0},  // "FC Nick Gyro    \0",  // 10
160
         {SPEAK_ERR_SENSOR,0},  // "FC Roll Gyro    \0",  // 11
162
         {SPEAK_ERR_SENSOR,0},  // "FC Roll Gyro    \0",  // 11
161
         {SPEAK_ERR_SENSOR,0},  // "FC Yaw Gyro     \0",  // 12
163
         {SPEAK_ERR_SENSOR,0},  // "FC Yaw Gyro     \0",  // 12
162
         {SPEAK_ERR_SENSOR,0},  // "FC Nick ACC     \0",  // 13
164
         {SPEAK_ERR_SENSOR,0},  // "FC Nick ACC     \0",  // 13
163
         {SPEAK_ERR_SENSOR,0},  // "FC Roll ACC     \0",  // 14
165
         {SPEAK_ERR_SENSOR,0},  // "FC Roll ACC     \0",  // 14
164
         {SPEAK_ERR_SENSOR,0},  // "FC Z-ACC        \0",  // 15
166
         {SPEAK_ERR_SENSOR,0},  // "FC Z-ACC        \0",  // 15
165
         {SPEAK_ERR_SENSOR,0},  // "Pressure sensor \0",  // 16
167
         {SPEAK_ERR_SENSOR,0},  // "Pressure sensor \0",  // 16
166
         {SPEAK_ERR_DATABUS,1}, // "I2C FC->BL-Ctrl \0",  // 17
168
         {SPEAK_ERR_DATABUS,1}, // "I2C FC->BL-Ctrl \0",  // 17
167
         {SPEAK_ERR_DATABUS,1}, // "Bl Missing      \0",  // 18
169
         {SPEAK_ERR_DATABUS,1}, // "Bl Missing      \0",  // 18
168
         {SPEAK_ERROR,0},               // "Mixer Error     \0",  // 19
170
         {SPEAK_ERROR,0},               // "Mixer Error     \0",  // 19
169
         {SPEAK_CF_OFF,1},              // "Carefree Error  \0",  // 20
171
         {SPEAK_CF_OFF,1},              // "Carefree Error  \0",  // 20
170
         {SPEAK_GPS_FIX,1},             // "GPS Fix lost    \0",  // 21
172
         {SPEAK_GPS_FIX,1},             // "GPS Fix lost    \0",  // 21
171
         {SPEAK_ERR_COMPASS,0}, // "Magnet Error    \0",  // 22
173
         {SPEAK_ERR_COMPASS,0}, // "Magnet Error    \0",  // 22
172
         {SPEAK_ERR_MOTOR,1},   // "Motor restart   \0",  // 23
174
         {SPEAK_ERR_MOTOR,1},   // "Motor restart   \0",  // 23
173
         {SPEAK_MAX_TEMPERAT,1},// "BL Limitation   \0",  // 24
175
         {SPEAK_MAX_TEMPERAT,1},// "BL Limitation   \0",  // 24
174
         {SPEAK_MAX_RANGE,1},   // "GPS Range       \0",  // 25
176
         {SPEAK_MAX_RANGE,1},   // "GPS Range       \0",  // 25
175
         {SPEAK_ERROR,1},               // "No SD-Card      \0",  // 26
177
         {SPEAK_ERROR,1},               // "No SD-Card      \0",  // 26
176
         {SPEAK_ERROR,1},               // "SD-Logging error\0",  // 27
178
         {SPEAK_ERROR,1},               // "SD-Logging error\0",  // 27
177
         {SPEAK_MAX_RANGE,1},   // "Flying range!   \0",  // 28
179
         {SPEAK_MAX_RANGE,1},   // "Flying range!   \0",  // 28
178
         {SPEAK_MAX_ALTITUD,1}, // "Max Altitude!   \0"   // 29
180
         {SPEAK_MAX_ALTITUD,1}, // "Max Altitude!   \0"   // 29
179
         {SPEAK_GPS_FIX,1},             // "No GPS fix      \0"   // 30
181
         {SPEAK_GPS_FIX,1},             // "No GPS fix      \0"   // 30
180
         {SPEAK_ERR_CALIBARTION,0},// "compass not cal." // 31
182
         {SPEAK_ERR_CALIBARTION,0},// "compass not cal." // 31
181
         {SPEAK_ERR_MOTOR,0},   // "BL-Selftest     \0"   // 32
183
         {SPEAK_ERR_MOTOR,0},   // "BL-Selftest     \0"   // 32
182
         {SPEAK_ERR_COMPASS,0}, // "no ext. compass"     // 33
184
         {SPEAK_ERR_COMPASS,0}, // "no ext. compass"     // 33
183
         {SPEAK_ERR_COMPASS,0}  // "compass sensor"      // 34
185
         {SPEAK_ERR_COMPASS,0}  // "compass sensor"      // 34
184
};
186
};
185
 
187
 
186
 
188
 
187
void GetHottestBl(void)
189
void GetHottestBl(void)
188
{
190
{
189
 static unsigned char search = 0,tmp_max,tmp_min,who;
191
 static unsigned char search = 0,tmp_max,tmp_min,who;
190
                if(Motor[search].Temperature > tmp_max) { tmp_max = Motor[search].Temperature; who = search;}
192
                if(Motor[search].Temperature > tmp_max) { tmp_max = Motor[search].Temperature; who = search;}
191
                else
193
                else
192
                if(Motor[search].Temperature) if(Motor[search].Temperature < tmp_min) tmp_min = Motor[search].Temperature;
194
                if(Motor[search].Temperature) if(Motor[search].Temperature < tmp_min) tmp_min = Motor[search].Temperature;
193
                if(++search >= MAX_MOTORS)
195
                if(++search >= MAX_MOTORS)
194
                {
196
                {
195
                 search = 0;
197
                 search = 0;
196
                 if(tmp_min != 255) MinBlTemperture = tmp_min; else MinBlTemperture = 0;
198
                 if(tmp_min != 255) MinBlTemperture = tmp_min; else MinBlTemperture = 0;
197
                 MaxBlTemperture = tmp_max;
199
                 MaxBlTemperture = tmp_max;
198
                 HottestBl = who;
200
                 HottestBl = who;
199
                 tmp_min = 255;
201
                 tmp_min = 255;
200
                 tmp_max = 0;
202
                 tmp_max = 0;
201
                 who = 0;
203
                 who = 0;
202
                 }
204
                 }
203
}
205
}
204
 
206
 
205
//---------------------------------------------------------------
207
//---------------------------------------------------------------
206
void Hott_ClearLine(unsigned char line)
208
void Hott_ClearLine(unsigned char line)
207
{
209
{
208
 HoTT_printfxy(0,line,"                     ");
210
 HoTT_printfxy(0,line,"                     ");
209
}
211
}
210
//---------------------------------------------------------------
212
//---------------------------------------------------------------
211
 
213
 
212
 
214
 
213
unsigned char HoTT_Waring(void)
215
unsigned char HoTT_Waring(void)
214
{
216
{
215
  unsigned char status = 0;
217
  unsigned char status = 0;
216
  static char old_status = 0;
218
  static char old_status = 0;
217
  static int repeat;
219
  static int repeat;
218
//if(Parameter_UserParam1) return(Parameter_UserParam1); 
220
//if(Parameter_UserParam1) return(Parameter_UserParam1); 
219
  ToNC_SpeakHoTT = SpeakHoTT;
221
  ToNC_SpeakHoTT = SpeakHoTT;
220
  if(FC_StatusFlags & FC_STATUS_LOWBAT)
222
  if(FC_StatusFlags & FC_STATUS_LOWBAT)
221
   {
223
   {
222
    if(LowVoltageLandingActive && (EE_Parameter.Receiver == RECEIVER_HOTT)) status = SPEAK_LANDING;
224
    if(LowVoltageLandingActive && (EE_Parameter.Receiver == RECEIVER_HOTT)) status = SPEAK_LANDING;
223
        else status = VOICE_MINIMALE_EINGANSSPANNUNG; // Jeti hat kein wort: "LANDEN"
225
        else status = VOICE_MINIMALE_EINGANSSPANNUNG; // Jeti hat kein wort: "LANDEN"
224
        if(SpeakHoTT && old_status == VOICE_MINIMALE_EINGANSSPANNUNG) status = SpeakHoTT; // das soll auch noch durch kommen
226
        if(SpeakHoTT && old_status == VOICE_MINIMALE_EINGANSSPANNUNG) status = SpeakHoTT; // das soll auch noch durch kommen
225
   }   
227
   }   
226
  else
228
  else
227
  if(NC_ErrorCode && NC_ErrorCode < MAX_ERR_NUMBER)     // Fehlercodes
229
  if(NC_ErrorCode && NC_ErrorCode < MAX_ERR_NUMBER)     // Fehlercodes
228
   {
230
   {
229
    if(MotorenEin || !pgm_read_byte(&HOTT_ERROR[NC_ErrorCode][1])) status = pgm_read_byte(&HOTT_ERROR[NC_ErrorCode][0]);
231
    if(MotorenEin || !pgm_read_byte(&HOTT_ERROR[NC_ErrorCode][1])) status = pgm_read_byte(&HOTT_ERROR[NC_ErrorCode][0]);
230
   }
232
   }
231
  if(!status)    // Sprachansagen
233
  if(!status)    // Sprachansagen
232
   {
234
   {
233
//      if(!(GetParamByte(PID_SPEAK_HOTT_CFG) & 0x01)) SpeakHoTT = 0;  // is the voice wanted?
235
//      if(!(GetParamByte(PID_SPEAK_HOTT_CFG) & 0x01)) SpeakHoTT = 0;  // is the voice wanted?
234
    if(!(EE_Parameter.GlobalConfig3 & CFG3_SPEAK_ALL)) SpeakHoTT = 0;  // is the voice wanted?
236
    if(!(EE_Parameter.GlobalConfig3 & CFG3_SPEAK_ALL)) SpeakHoTT = 0;  // is the voice wanted?
235
    else status = SpeakHoTT;
237
    else status = SpeakHoTT;
236
   }
238
   }
237
   else ToNC_SpeakHoTT = status;
239
   else ToNC_SpeakHoTT = status;
238
 
240
 
239
  if(old_status == status) // Gleichen Fehler nur alle 4 sek bringen
241
  if(old_status == status) // Gleichen Fehler nur alle 4 sek bringen
240
   {
242
   {
241
    if(!CheckDelay(repeat)) return(0);
243
    if(!CheckDelay(repeat)) return(0);
242
        repeat = SetDelay(4000);
244
        repeat = SetDelay(4000);
243
   }
245
   }
244
   else repeat = SetDelay(2000);
246
   else repeat = SetDelay(2000);
245
 
247
 
246
  if(status)
248
  if(status)
247
   {
249
   {
248
    if(status == SpeakHoTT) SpeakHoTT = 0;
250
    if(status == SpeakHoTT) SpeakHoTT = 0;
249
   }   
251
   }   
250
  old_status = status;
252
  old_status = status;
251
//  DebugOut.Analog[16] = status;
253
//  DebugOut.Analog[16] = status;
252
  return(status);
254
  return(status);
253
}
255
}
254
 
256
 
255
/*
257
/*
256
unsigned char HoTTErrorCode(void)
258
unsigned char HoTTErrorCode(void)
257
{
259
{
258
 return(NC_ErrorCode);
260
 return(NC_ErrorCode);
259
}
261
}
260
*/
262
*/
261
//---------------------------------------------------------------
263
//---------------------------------------------------------------
262
void NC_Fills_HoTT_Telemety(void)
264
void NC_Fills_HoTT_Telemety(void)
263
{
265
{
264
 unsigned char *ptr = NULL;
266
 unsigned char *ptr = NULL;
265
 unsigned char max = 0,i,z;
267
 unsigned char max = 0,i,z;
266
 switch(FromNaviCtrl.Param.Byte[11])
268
 switch(FromNaviCtrl.Param.Byte[11])
267
  {
269
  {
268
   case HOTT_VARIO_PACKET_ID:
270
   case HOTT_VARIO_PACKET_ID:
269
                ptr = (unsigned char *) &VarioPacket;
271
                ptr = (unsigned char *) &VarioPacket;
270
                max = sizeof(VarioPacket);
272
                max = sizeof(VarioPacket);
271
                break;
273
                break;
272
   case HOTT_GPS_PACKET_ID:
274
   case HOTT_GPS_PACKET_ID:
273
                ptr = (unsigned char *) &GPSPacket;
275
                ptr = (unsigned char *) &GPSPacket;
274
                max = sizeof(GPSPacket);
276
                max = sizeof(GPSPacket);
275
                break;
277
                break;
276
   case HOTT_ELECTRIC_AIR_PACKET_ID:
278
   case HOTT_ELECTRIC_AIR_PACKET_ID:
277
                ptr = (unsigned char *) &ElectricAirPacket;
279
                ptr = (unsigned char *) &ElectricAirPacket;
278
                max = sizeof(ElectricAirPacket);
280
                max = sizeof(ElectricAirPacket);
279
                break;
281
                break;
280
   case HOTT_GENERAL_PACKET_ID:
282
   case HOTT_GENERAL_PACKET_ID:
281
                ptr = (unsigned char *) &HoTTGeneral;
283
                ptr = (unsigned char *) &HoTTGeneral;
282
                max = sizeof(HoTTGeneral);
284
                max = sizeof(HoTTGeneral);
283
                break;
285
                break;
284
   case JETI_GPS_PACKET_ID1:
286
   case JETI_GPS_PACKET_ID1:
285
                ptr = (unsigned char *) &JetiExData[14].Value;
287
                ptr = (unsigned char *) &JetiExData[14].Value;
286
                max = sizeof(JetiExData[14].Value);
288
                max = sizeof(JetiExData[14].Value);
287
                break;
289
                break;
288
   case JETI_GPS_PACKET_ID2:
290
   case JETI_GPS_PACKET_ID2:
289
                ptr = (unsigned char *) &JetiExData[15].Value;
291
                ptr = (unsigned char *) &JetiExData[15].Value;
290
                max = sizeof(JetiExData[15].Value);
292
                max = sizeof(JetiExData[15].Value);
291
                break;
293
                break;
292
   case HOTT_WPL_NAME:
294
   case HOTT_WPL_NAME:
293
                ptr = (unsigned char *) WPL_Name;
295
                ptr = (unsigned char *) WPL_Name;
294
                max = sizeof(WPL_Name)-1;
296
                max = sizeof(WPL_Name)-1;
295
                break;
297
                break;
296
 
298
 
297
  }
299
  }
298
 z = FromNaviCtrl.Param.Byte[0]; // Data allocation
300
 z = FromNaviCtrl.Param.Byte[0]; // Data allocation
299
 
301
 
300
 for(i=0; i < FromNaviCtrl.Param.Byte[1]; i++)
302
 for(i=0; i < FromNaviCtrl.Param.Byte[1]; i++)
301
  {
303
  {
302
   if(z >= max) break;
304
   if(z >= max) break;
303
   ptr[z] = FromNaviCtrl.Param.Byte[2+i];
305
   ptr[z] = FromNaviCtrl.Param.Byte[2+i];
304
   z++;
306
   z++;
305
  }
307
  }
306
}
308
}
307
 
309
 
308
unsigned int BuildHoTT_Vario(void)
310
unsigned int BuildHoTT_Vario(void)
309
{
311
{
310
 unsigned int tmp = VARIO_ZERO;
312
 unsigned int tmp = VARIO_ZERO;
311
 if(VarioCharacter == '+' || VarioCharacter == '-')
313
 if(VarioCharacter == '+' || VarioCharacter == '-')
312
  {
314
  {
313
   tmp = VARIO_ZERO + (AltitudeSetpointTrimming * EE_Parameter.Hoehe_Verstaerkung) / 3;
315
   tmp = VARIO_ZERO + (AltitudeSetpointTrimming * EE_Parameter.Hoehe_Verstaerkung) / 3;
314
   if(tmp < VARIO_ZERO && tmp > VARIO_ZERO - 50) tmp = VARIO_ZERO - 50; // weil es sonst erst bei < 0,5m/sek piept
316
   if(tmp < VARIO_ZERO && tmp > VARIO_ZERO - 50) tmp = VARIO_ZERO - 50; // weil es sonst erst bei < 0,5m/sek piept
315
  }
317
  }
316
 else
318
 else
317
 if((VarioCharacter == ' ') && (FC_StatusFlags & FC_STATUS_FLY))
319
 if((VarioCharacter == ' ') && (FC_StatusFlags & FC_STATUS_FLY))
318
  {
320
  {
319
   tmp = VARIO_ZERO + HoTTVarioMeter;
321
   tmp = VARIO_ZERO + HoTTVarioMeter;
320
   if(tmp > VARIO_ZERO)
322
   if(tmp > VARIO_ZERO)
321
    {
323
    {
322
     if(tmp < VARIO_ZERO + 100) tmp = VARIO_ZERO;
324
     if(tmp < VARIO_ZERO + 100) tmp = VARIO_ZERO;
323
         else tmp -= 100;
325
         else tmp -= 100;
324
        }
326
        }
325
   if(tmp < VARIO_ZERO)
327
   if(tmp < VARIO_ZERO)
326
    {
328
    {
327
     if(tmp > VARIO_ZERO - 100) tmp = VARIO_ZERO;
329
     if(tmp > VARIO_ZERO - 100) tmp = VARIO_ZERO;
328
         else tmp += 100;
330
         else tmp += 100;
329
        }
331
        }
330
  }
332
  }
331
 else
333
 else
332
 if(VarioCharacter == '^') tmp = VARIO_ZERO + FromNC_AltitudeSpeed * 10;
334
 if(VarioCharacter == '^') tmp = VARIO_ZERO + FromNC_AltitudeSpeed * 10;
333
 else
335
 else
334
 if(VarioCharacter == 'v') tmp = VARIO_ZERO - FromNC_AltitudeSpeed * 10;
336
 if(VarioCharacter == 'v') tmp = VARIO_ZERO - FromNC_AltitudeSpeed * 10;
335
 return(tmp);
337
 return(tmp);
336
}
338
}
337
 
339
 
338
//---------------------------------------------------------------
340
//---------------------------------------------------------------
339
unsigned char HoTT_Telemety(unsigned char packet_request)
341
unsigned char HoTT_Telemety(unsigned char packet_request)
340
{
342
{
341
 unsigned char i;
343
 unsigned char i = 0;
342
  //Debug("rqst: %02X",packet_request);
344
  //Debug("rqst: %02X",packet_request);
343
 
345
 
344
 switch(packet_request)
346
 switch(packet_request)
345
 {
347
 {
346
  case HOTT_VARIO_PACKET_ID:
348
  case HOTT_VARIO_PACKET_ID:
347
                GPSPacket.WarnBeep = HoTT_Waring(); // Achtung: das ist richtig hier, damit der Varioton schon vorher abgestellt wird
349
                GPSPacket.WarnBeep = HoTT_Waring(); // Achtung: das ist richtig hier, damit der Varioton schon vorher abgestellt wird
348
                VarioPacket.Altitude = HoehenWert/100 + 500;  
350
                VarioPacket.Altitude = HoehenWert/100 + 500;  
349
                if(!GPSPacket.WarnBeep) VarioPacket.m_sec = BuildHoTT_Vario(); else VarioPacket.m_sec = VARIO_ZERO;
351
                if(!GPSPacket.WarnBeep) VarioPacket.m_sec = BuildHoTT_Vario(); else VarioPacket.m_sec = VARIO_ZERO;
350
                VarioPacket.m_3sec = VarioPacket.m_sec;
352
                VarioPacket.m_3sec = VarioPacket.m_sec;
351
                VarioPacket.m_10sec = VarioPacket.m_sec;
353
                VarioPacket.m_10sec = VarioPacket.m_sec;
352
                if (VarioPacket.Altitude < VarioPacket.MinAltitude) VarioPacket.MinAltitude = VarioPacket.Altitude;
354
                if (VarioPacket.Altitude < VarioPacket.MinAltitude) VarioPacket.MinAltitude = VarioPacket.Altitude;
353
                if (VarioPacket.Altitude > VarioPacket.MaxAltitude) VarioPacket.MaxAltitude = VarioPacket.Altitude;            
355
                if (VarioPacket.Altitude > VarioPacket.MaxAltitude) VarioPacket.MaxAltitude = VarioPacket.Altitude;            
354
                VarioPacket.WarnBeep = 0;//HoTT_Waring();
356
                VarioPacket.WarnBeep = 0;//HoTT_Waring();
355
                HoTT_DataPointer = (unsigned char *) &VarioPacket;
357
                HoTT_DataPointer = (unsigned char *) &VarioPacket;
356
        VarioPacket.FreeCharacters[0] = VarioCharacter;
358
        VarioPacket.FreeCharacters[0] = VarioCharacter;
357
    if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) VarioPacket.FreeCharacters[1] = 'C'; else VarioPacket.FreeCharacters[1] = ' ';
359
    if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) VarioPacket.FreeCharacters[1] = 'C'; else VarioPacket.FreeCharacters[1] = ' ';
358
//      VarioPacket.FreeCharacters[2] = ' ';
360
//      VarioPacket.FreeCharacters[2] = ' ';
359
    if(NC_ErrorCode)
361
    if(NC_ErrorCode)
360
         {
362
         {
361
                VarioPacket.Text[0] = NC_ErrorCode/10 + '0';
363
                VarioPacket.Text[0] = NC_ErrorCode/10 + '0';
362
                VarioPacket.Text[1] = NC_ErrorCode%10 + '0';
364
                VarioPacket.Text[1] = NC_ErrorCode%10 + '0';
363
                VarioPacket.Text[2] = ':';
365
                VarioPacket.Text[2] = ':';
364
                for(i=0; i<16;i++) VarioPacket.Text[i+3] = pgm_read_byte(&NC_ERROR_TEXT[NC_ErrorCode][i]);
366
                for(i=0; i<16;i++) VarioPacket.Text[i+3] = pgm_read_byte(&NC_ERROR_TEXT[NC_ErrorCode][i]);
365
                VarioPacket.Text[19] = ' ';
367
                VarioPacket.Text[19] = ' ';
366
                VarioPacket.Text[20] = ' ';
368
                VarioPacket.Text[20] = ' ';
367
         }
369
         }
368
         else
370
         else
369
         if(LowVoltageLandingActive) for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&LANDING[i]); // no Error
371
         if(LowVoltageLandingActive) for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&LANDING[i]); // no Error
370
     else
372
     else
371
         if(FC_StatusFlags & FC_STATUS_LOWBAT) for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&UNDERVOLTAGE[i]); // no Error
373
         if(FC_StatusFlags & FC_STATUS_LOWBAT) for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&UNDERVOLTAGE[i]); // no Error
372
         else
374
         else
373
         if(ShowSettingNameTime) // no Error
375
         if(ShowSettingNameTime) // no Error
374
         {                  
376
         {                  
375
          for(i=0; i<sizeof(SETTING);i++) VarioPacket.Text[i] = pgm_read_byte(&SETTING[i]);
377
          for(i=0; i<sizeof(SETTING);i++) VarioPacket.Text[i] = pgm_read_byte(&SETTING[i]);
376
      VarioPacket.Text[4] = '0' + ActiveParamSet;
378
      VarioPacket.Text[4] = '0' + ActiveParamSet;
377
          for(i=0; i<sizeof(EE_Parameter.Name);i++) VarioPacket.Text[i+7] = EE_Parameter.Name[i]; // no Error
379
          for(i=0; i<sizeof(EE_Parameter.Name);i++) VarioPacket.Text[i+7] = EE_Parameter.Name[i]; // no Error
-
 
380
      if(FC_StatusFlags3 & FC_STATUS3_BOAT)
-
 
381
                {
-
 
382
         VarioPacket.Text[17] = 'B';
-
 
383
         VarioPacket.Text[18] = 'O';
-
 
384
         VarioPacket.Text[19] = 'A';
-
 
385
         VarioPacket.Text[20] = 'T';
-
 
386
                }
-
 
387
          else
-
 
388
                {
378
      VarioPacket.Text[18] = ' ';
389
         VarioPacket.Text[18] = ' ';
379
      VarioPacket.Text[19] = ' ';
390
         VarioPacket.Text[19] = ' ';
380
      VarioPacket.Text[20] = ' ';
391
         VarioPacket.Text[20] = ' ';
-
 
392
                }
381
         }
393
         }
382
         else    
394
         else    
383
     if(NaviData_WaypointNumber)
395
     if(NaviData_WaypointNumber)
384
         {    
396
         {    
385
          unsigned int tmp_int;
397
          unsigned int tmp_int;
386
      unsigned char tmp;
398
      unsigned char tmp;
387
      VarioPacket.Text[0] = 'W'; VarioPacket.Text[1] = 'P';
399
      VarioPacket.Text[0] = 'W'; VarioPacket.Text[1] = 'P';
388
      VarioPacket.Text[2] = ' ';
400
      VarioPacket.Text[2] = ' ';
389
      VarioPacket.Text[3] = '0'+(NaviData_WaypointIndex) / 10;
401
      VarioPacket.Text[3] = '0'+(NaviData_WaypointIndex) / 10;
390
      VarioPacket.Text[4] = '0'+(NaviData_WaypointIndex) % 10;
402
      VarioPacket.Text[4] = '0'+(NaviData_WaypointIndex) % 10;
391
      VarioPacket.Text[5] = '/';
403
      VarioPacket.Text[5] = '/';
392
      VarioPacket.Text[6] = '0'+(NaviData_WaypointNumber) / 10;
404
      VarioPacket.Text[6] = '0'+(NaviData_WaypointNumber) / 10;
393
      VarioPacket.Text[7] = '0'+(NaviData_WaypointNumber) % 10;
405
      VarioPacket.Text[7] = '0'+(NaviData_WaypointNumber) % 10;
394
      VarioPacket.Text[8] = ' ';
406
      VarioPacket.Text[8] = ' ';
395
          tmp_int = NaviData_TargetDistance;
407
          tmp_int = NaviData_TargetDistance;
396
      if(tmp_int > 1000) { VarioPacket.Text[9] = '0'+(tmp_int) / 1000; tmp_int %= 1000;}
408
      if(tmp_int > 1000) { VarioPacket.Text[9] = '0'+(tmp_int) / 1000; tmp_int %= 1000;}
397
          else VarioPacket.Text[9] = ' ';
409
          else VarioPacket.Text[9] = ' ';
398
      if(tmp_int > 100) { VarioPacket.Text[10] = '0'+(tmp_int) / 100; tmp_int %= 100;}
410
      if(tmp_int > 100) { VarioPacket.Text[10] = '0'+(tmp_int) / 100; tmp_int %= 100;}
399
          else VarioPacket.Text[10] = ' ';
411
          else VarioPacket.Text[10] = ' ';
400
      VarioPacket.Text[11] = '0'+(tmp_int) / 10;
412
      VarioPacket.Text[11] = '0'+(tmp_int) / 10;
401
      VarioPacket.Text[12] = '0'+(tmp_int) % 10;
413
      VarioPacket.Text[12] = '0'+(tmp_int) % 10;
402
      VarioPacket.Text[13] = 'm';
414
      VarioPacket.Text[13] = 'm';
403
      VarioPacket.Text[14] = ' ';
415
      VarioPacket.Text[14] = ' ';
404
      tmp = NaviData_TargetHoldTime;
416
      tmp = NaviData_TargetHoldTime;
405
          if(tmp > 100) { VarioPacket.Text[15] = '0'+(tmp) / 100; tmp %= 100;} else VarioPacket.Text[15] = ' ';
417
          if(tmp > 100) { VarioPacket.Text[15] = '0'+(tmp) / 100; tmp %= 100;} else VarioPacket.Text[15] = ' ';
406
      VarioPacket.Text[16] = '0'+(tmp) / 10;
418
      VarioPacket.Text[16] = '0'+(tmp) / 10;
407
      VarioPacket.Text[17] = '0'+(tmp) % 10;
419
      VarioPacket.Text[17] = '0'+(tmp) % 10;
408
      VarioPacket.Text[18] = 's';
420
      VarioPacket.Text[18] = 's';
409
      VarioPacket.Text[19] = ' ';
421
      VarioPacket.Text[19] = ' ';
410
      VarioPacket.Text[20] = ' ';
422
      VarioPacket.Text[20] = ' ';
411
         }
423
         }
412
         else
424
         else
-
 
425
         if(NC_To_FC_Flags & NC_TO_FC_SIMULATION_ACTIVE)
-
 
426
         {
-
 
427
          for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&SIMULATION[i]);
-
 
428
         }
-
 
429
         else
413
         if(!CalibrationDone)
430
         if(!CalibrationDone)
414
         {
431
         {
415
          for(i=0; i<17;i++) VarioPacket.Text[i] = pgm_read_byte(&MIKROKOPTER[i+2]); // no Error and not calibrated
432
          for(i=0; i<17;i++) VarioPacket.Text[i] = pgm_read_byte(&MIKROKOPTER[i+2]); // no Error and not calibrated
416
      VarioPacket.Text[16] = '0'+VERSION_MAJOR;
433
      VarioPacket.Text[16] = '0'+VERSION_MAJOR;
417
      VarioPacket.Text[17] = '.';
434
      VarioPacket.Text[17] = '.';
418
      VarioPacket.Text[18] = '0'+VERSION_MINOR/10;
435
      VarioPacket.Text[18] = '0'+VERSION_MINOR/10;
419
      VarioPacket.Text[19] = '0'+VERSION_MINOR%10;
436
      VarioPacket.Text[19] = '0'+VERSION_MINOR%10;
420
      VarioPacket.Text[20] = 'a'+VERSION_PATCH;
437
      VarioPacket.Text[20] = 'a'+VERSION_PATCH;
421
         }
438
         }
422
         else
439
         else
423
         {
440
         {
-
 
441
          if(FC_StatusFlags3 & FC_STATUS3_BOAT) for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&BOAT_MODE[i]); // no Error
424
          for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&MIKROKOPTER[i]); // no Error
442
          else  for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&MIKROKOPTER[i]); // no Error
425
if(RedundanceBlOperation) VarioPacket.Text[0] = 'R';
443
          if(FC_StatusFlags3 & FC_STATUS3_REDUNDANCE)  VarioPacket.Text[0] = 'R';
426
         }
444
         }
427
                return(sizeof(VarioPacket));
445
                return(sizeof(VarioPacket));
428
                break;
446
                break;
429
 
447
 
430
  case HOTT_GPS_PACKET_ID:
448
  case HOTT_GPS_PACKET_ID:
431
                GPSPacket.Altitude = HoehenWert/100 + 500;  
449
                GPSPacket.Altitude = HoehenWert/100 + 500;  
432
//              GPSPacket.Distance = GPSInfo.HomeDistance/10;  // macht die NC
450
//              GPSPacket.Distance = GPSInfo.HomeDistance/10;  // macht die NC
433
//              GPSPacket.Heading = GPSInfo.HomeBearing/2;     // macht die NC
451
//              GPSPacket.Heading = GPSInfo.HomeBearing/2;     // macht die NC
434
//              GPSPacket.Speed = (GPSInfo.Speed * 36) / 10;   // macht die NC
452
//              GPSPacket.Speed = (GPSInfo.Speed * 36) / 10;   // macht die NC
435
//      GPSPacket.WarnBeep = HoTT_Waring();                //(wird jetzt weiter oben gemacht)
453
//      GPSPacket.WarnBeep = HoTT_Waring();                //(wird jetzt weiter oben gemacht)
436
                if(!GPSPacket.WarnBeep) GPSPacket.m_sec = BuildHoTT_Vario(); else GPSPacket.m_sec = VARIO_ZERO;
454
                if(!GPSPacket.WarnBeep) GPSPacket.m_sec = BuildHoTT_Vario(); else GPSPacket.m_sec = VARIO_ZERO;
437
                GPSPacket.m_3sec = 120;
455
                GPSPacket.m_3sec = 120;
438
                GPSPacket.NumOfSats = GPSInfo.NumOfSats;
456
                GPSPacket.NumOfSats = GPSInfo.NumOfSats;
439
                if(GPSInfo.Flags & FLAG_DIFFSOLN) GPSPacket.SatFix = 'D';
457
                if(GPSInfo.Flags & FLAG_DIFFSOLN) GPSPacket.SatFix = 'D';
440
                else
458
                else
441
        if(GPSInfo.SatFix == SATFIX_3D) GPSPacket.SatFix = ' ';
459
        if(GPSInfo.SatFix == SATFIX_3D) GPSPacket.SatFix = ' ';
442
                else GPSPacket.SatFix = '!';
460
                else GPSPacket.SatFix = '!';
443
                HoTT_DataPointer = (unsigned char *) &GPSPacket;
461
                HoTT_DataPointer = (unsigned char *) &GPSPacket;
444
                GPSPacket.FreeCharacters[0] = NC_GPS_ModeCharacter;
462
                GPSPacket.FreeCharacters[0] = NC_GPS_ModeCharacter;
445
                GPSPacket.FreeCharacters[2] = GPSPacket.SatFix;
463
                GPSPacket.FreeCharacters[2] = GPSPacket.SatFix;
446
                GPSPacket.HomeDirection = GPSInfo.HomeBearing / 2;//230;
464
                GPSPacket.HomeDirection = GPSInfo.HomeBearing / 2;//230;
447
                return(sizeof(GPSPacket));  
465
                return(sizeof(GPSPacket));  
448
                break;
466
                break;
449
  case HOTT_ELECTRIC_AIR_PACKET_ID:
467
  case HOTT_ELECTRIC_AIR_PACKET_ID:
450
                GetHottestBl();
468
                GetHottestBl();
451
                ElectricAirPacket.Altitude = HoehenWert/100 + 500;
469
                ElectricAirPacket.Altitude = HoehenWert/100 + 500;
452
                ElectricAirPacket.Battery1 = UBat;
470
                ElectricAirPacket.Battery1 = UBat;
453
                ElectricAirPacket.Battery2 = UBat;
471
                ElectricAirPacket.Battery2 = UBat;
454
                ElectricAirPacket.VoltageCell1 = CompassCorrected / 2;
472
                ElectricAirPacket.VoltageCell1 = CompassCorrected / 2;
455
                ElectricAirPacket.VoltageCell8 = ElectricAirPacket.VoltageCell1;
473
                ElectricAirPacket.VoltageCell8 = ElectricAirPacket.VoltageCell1;
456
                ElectricAirPacket.VoltageCell6 = GPSInfo.HomeBearing / 2;
474
                ElectricAirPacket.VoltageCell6 = GPSInfo.HomeBearing / 2;
457
                ElectricAirPacket.VoltageCell7 = GPSInfo.HomeDistance/20;
475
                ElectricAirPacket.VoltageCell7 = GPSInfo.HomeDistance/20;
458
                ElectricAirPacket.VoltageCell13 = ElectricAirPacket.VoltageCell6;
476
                ElectricAirPacket.VoltageCell13 = ElectricAirPacket.VoltageCell6;
459
                ElectricAirPacket.VoltageCell14 = ElectricAirPacket.VoltageCell7;
477
                ElectricAirPacket.VoltageCell14 = ElectricAirPacket.VoltageCell7;
460
        if(!GPSPacket.WarnBeep) ElectricAirPacket.m_sec = BuildHoTT_Vario(); else ElectricAirPacket.m_sec = VARIO_ZERO;
478
        if(!GPSPacket.WarnBeep) ElectricAirPacket.m_sec = BuildHoTT_Vario(); else ElectricAirPacket.m_sec = VARIO_ZERO;
461
                ElectricAirPacket.m_3sec = 120;
479
                ElectricAirPacket.m_3sec = 120;
462
                ElectricAirPacket.InputVoltage = UBat;
480
                ElectricAirPacket.InputVoltage = UBat;
463
                ElectricAirPacket.Temperature1 = MinBlTemperture + 20;
481
                ElectricAirPacket.Temperature1 = MinBlTemperture + 20;
464
                ElectricAirPacket.Temperature2 = MaxBlTemperture + 20;
482
                ElectricAirPacket.Temperature2 = MaxBlTemperture + 20;
465
                ElectricAirPacket.Capacity = Capacity.UsedCapacity/10;
483
                ElectricAirPacket.Capacity = Capacity.UsedCapacity/10;
466
//              ElectricAirPacket.WarnBeep = 0;//HoTT_Waring();
484
//              ElectricAirPacket.WarnBeep = 0;//HoTT_Waring();
467
ElectricAirPacket.WarnBeep = GPSPacket.WarnBeep;
485
ElectricAirPacket.WarnBeep = GPSPacket.WarnBeep;
468
                ElectricAirPacket.Current = Capacity.ActualCurrent;
486
                ElectricAirPacket.Current = Capacity.ActualCurrent;
469
                HoTT_DataPointer = (unsigned char *) &ElectricAirPacket;
487
                HoTT_DataPointer = (unsigned char *) &ElectricAirPacket;
470
                ElectricAirPacket.FlightTimeMinutes = FlugSekunden / 60;
488
                ElectricAirPacket.FlightTimeMinutes = FlugSekunden / 60;
471
                ElectricAirPacket.FlightTimeSeconds = FlugSekunden % 60;
489
                ElectricAirPacket.FlightTimeSeconds = FlugSekunden % 60;
472
                return(sizeof(ElectricAirPacket));
490
                return(sizeof(ElectricAirPacket));
473
                break;
491
                break;
474
  case HOTT_GENERAL_PACKET_ID:
492
  case HOTT_GENERAL_PACKET_ID:
475
                GetHottestBl();
493
                GetHottestBl();
476
                HoTTGeneral.Rpm = GPSInfo.HomeDistance/100;
494
                HoTTGeneral.Rpm = GPSInfo.HomeDistance/100;
477
                HoTTGeneral.VoltageCell1 = CompassCorrected / 2;
495
                HoTTGeneral.VoltageCell1 = CompassCorrected / 2;
478
                HoTTGeneral.VoltageCell2 = KompassValue / 2;
496
                HoTTGeneral.VoltageCell2 = KompassValue / 2;
479
                //HoTTGeneral.VoltageCell3 = Magnetstaerke -> macht NC
497
                //HoTTGeneral.VoltageCell3 = Magnetstaerke -> macht NC
480
                //HoTTGeneral.VoltageCell4 = Inclinition -> macht NC
498
                //HoTTGeneral.VoltageCell4 = Inclinition -> macht NC
481
                HoTTGeneral.VoltageCell5 = DebugOut.Analog[28]; // I2C ErrorCounter
499
                HoTTGeneral.VoltageCell5 = DebugOut.Analog[28]; // I2C ErrorCounter
482
                HoTTGeneral.VoltageCell6 = GPSInfo.HomeBearing / 2;
500
                HoTTGeneral.VoltageCell6 = GPSInfo.HomeBearing / 2;
483
                if(UBat > BattLowVoltageWarning + 2) HoTTGeneral.FuelPercent = (UBat - (BattLowVoltageWarning + 2)) * 3;
501
                if(UBat > BattLowVoltageWarning + 2) HoTTGeneral.FuelPercent = (UBat - (BattLowVoltageWarning + 2)) * 3;
484
                else HoTTGeneral.FuelPercent = 0;
502
                else HoTTGeneral.FuelPercent = 0;
485
                if(HoTTGeneral.FuelPercent > 100) HoTTGeneral.FuelPercent = 100;
503
                if(HoTTGeneral.FuelPercent > 100) HoTTGeneral.FuelPercent = 100;
486
                HoTTGeneral.FuelCapacity = NC_ErrorCode;//HoehenWert/100; // Oelpegel
504
                HoTTGeneral.FuelCapacity = NC_ErrorCode;//HoehenWert/100; // Oelpegel
487
//              if(HoTTGeneral.FuelCapacity < 0) HoTTGeneral.FuelCapacity = 0;
505
//              if(HoTTGeneral.FuelCapacity < 0) HoTTGeneral.FuelCapacity = 0;
488
                HoTTGeneral.Altitude = HoehenWert/100 + 500;
506
                HoTTGeneral.Altitude = HoehenWert/100 + 500;
489
                HoTTGeneral.Battery1 = UBat;
507
                HoTTGeneral.Battery1 = UBat;
490
                HoTTGeneral.Battery2 = UBat;
508
                HoTTGeneral.Battery2 = UBat;
491
                if(!GPSPacket.WarnBeep) HoTTGeneral.m_sec =  BuildHoTT_Vario(); else  HoTTGeneral.m_sec = VARIO_ZERO;
509
                if(!GPSPacket.WarnBeep) HoTTGeneral.m_sec =  BuildHoTT_Vario(); else  HoTTGeneral.m_sec = VARIO_ZERO;
492
                HoTTGeneral.m_3sec = 120 + GPSPacket.WarnBeep;
510
                HoTTGeneral.m_3sec = 120 + GPSPacket.WarnBeep;
493
                HoTTGeneral.InputVoltage = UBat;
511
                HoTTGeneral.InputVoltage = UBat;
494
                HoTTGeneral.Temperature1 = MinBlTemperture + 20;
512
                HoTTGeneral.Temperature1 = MinBlTemperture + 20;
495
                HoTTGeneral.Temperature2 = MaxBlTemperture + 20;
513
                HoTTGeneral.Temperature2 = MaxBlTemperture + 20;
496
                HoTTGeneral.Capacity = Capacity.UsedCapacity/10;
514
                HoTTGeneral.Capacity = Capacity.UsedCapacity/10;
497
                HoTTGeneral.WarnBeep = 0;//HoTT_Waring();
515
                HoTTGeneral.WarnBeep = 0;//HoTT_Waring();
498
                HoTTGeneral.Current = Capacity.ActualCurrent;
516
                HoTTGeneral.Current = Capacity.ActualCurrent;
499
//HoTTGeneral.ErrorNumber = HoTTErrorCode();
517
//HoTTGeneral.ErrorNumber = HoTTErrorCode();
500
                HoTT_DataPointer = (unsigned char *) &HoTTGeneral;
518
                HoTT_DataPointer = (unsigned char *) &HoTTGeneral;
501
                return(sizeof(HoTTGeneral));
519
                return(sizeof(HoTTGeneral));
502
                break;
520
                break;
503
  default: return(0);
521
  default: return(0);
504
  }            
522
  }            
505
}
523
}
506
 
524
 
507
//---------------------------------------------------------------
525
//---------------------------------------------------------------
508
void HoTT_Menu(void)
526
void HoTT_Menu(void)
509
{
527
{
510
 static unsigned char line, page = 0,show_current = 0,show_mag = 0, show_poti = 0;
528
 static unsigned char line, page = 0,show_current = 0,show_mag = 0, show_poti = 0;
511
 unsigned char tmp;
529
 unsigned char tmp;
512
 HoTTVarioMeter = (HoTTVarioMeter * 7 + VarioMeter) / 8;
530
 HoTTVarioMeter = (HoTTVarioMeter * 7 + VarioMeter) / 8;
513
 
531
 
514
// if(HottKeyboard) {beeptime = 1000;};  
532
// if(HottKeyboard) {beeptime = 1000;};  
515
 
533
 
516
 switch(page)
534
 switch(page)
517
 {
535
 {
518
  case 0:
536
  case 0:
519
  switch(line++)
537
  switch(line++)
520
  {
538
  {
521
        case 0:  
539
        case 0:  
522
                if(FC_StatusFlags & FC_STATUS_LOWBAT)
540
                if(FC_StatusFlags & FC_STATUS_LOWBAT)
523
                         HoTT_printfxy_BLINK(0,0,"  %2i.%1iV  ",UBat/10, UBat%10)
541
                         HoTT_printfxy_BLINK(0,0,"  %2i.%1iV  ",UBat/10, UBat%10)
524
                        else
542
                        else
525
                         HoTT_printfxy(0,0,"  %2i.%1iV  ",UBat/10, UBat%10)
543
                         HoTT_printfxy(0,0,"  %2i.%1iV  ",UBat/10, UBat%10)
526
 
544
 
527
                        if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG)
545
                        if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG)
528
                          {
546
                          {
529
                           if(HoehenReglerAktiv)        HoTT_printfxy_INV(10,0,"ALT:%4im %c", (int16_t)(HoehenWert/100),VarioCharacter)
547
                           if(HoehenReglerAktiv)        HoTT_printfxy_INV(10,0,"ALT:%4im %c", (int16_t)(HoehenWert/100),VarioCharacter)
530
                           else                                         HoTT_printfxy(10,0,"ALT:%4im  ", (int16_t)(HoehenWert/100))
548
                           else                                         HoTT_printfxy(10,0,"ALT:%4im  ", (int16_t)(HoehenWert/100))
531
                           }
549
                           }
532
            else    HoTT_printfxy(10,0,"ALT:---- ");
550
            else    HoTT_printfxy(10,0,"ALT:---- ");
533
                        break;
551
                        break;
534
        case 1:  
552
        case 1:  
535
                if(FC_StatusFlags & FC_STATUS_LOWBAT)
553
                if(FC_StatusFlags & FC_STATUS_LOWBAT)
536
                         HoTT_printfxy_BLINK(0,1,"  %2i:%02i  ",FlugSekunden/60,FlugSekunden%60)
554
                         HoTT_printfxy_BLINK(0,1,"  %2i:%02i  ",FlugSekunden/60,FlugSekunden%60)
537
            else   HoTT_printfxy(0,1,"  %2i:%02i  ",FlugSekunden/60,FlugSekunden%60);                      
555
            else   HoTT_printfxy(0,1,"  %2i:%02i  ",FlugSekunden/60,FlugSekunden%60);                      
538
                        HoTT_printfxy(10,1,"DIR: %3d%c",CompassCorrected, HoTT_GRAD);
556
                        HoTT_printfxy(10,1,"DIR: %3d%c",CompassCorrected, HoTT_GRAD);
539
                        if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) HoTT_printfxy_INV(20,1,"C") else HoTT_printfxy(20,1," ");
557
                        if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) HoTT_printfxy_INV(20,1,"C") else HoTT_printfxy(20,1," ");
540
            break;
558
            break;
541
        case 2:
559
        case 2:
542
                if(FC_StatusFlags & FC_STATUS_LOWBAT)
560
                if(FC_StatusFlags & FC_STATUS_LOWBAT)
543
                         HoTT_printfxy_BLINK(0,2,"  %5i  ",Capacity.UsedCapacity)
561
                         HoTT_printfxy_BLINK(0,2,"  %5i  ",Capacity.UsedCapacity)
544
            else   HoTT_printfxy(0,2,"  %5i  ",Capacity.UsedCapacity);                     
562
            else   HoTT_printfxy(0,2,"  %5i  ",Capacity.UsedCapacity);                     
545
                        HoTT_printfxy(12,2,"I:%2i.%1iA ",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10);
563
                        HoTT_printfxy(12,2,"I:%2i.%1iA ",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10);
546
                        break;
564
                        break;
547
        case 3:
565
        case 3:
548
                        HoTT_printfxy(9,0,":");
566
                        HoTT_printfxy(9,0,":");
549
                        HoTT_printfxy(9,1,":");
567
                        HoTT_printfxy(9,1,":");
550
                        HoTT_printfxy(9,2,":");
568
                        HoTT_printfxy(9,2,":");
551
                        HoTT_printfxy(0,3,"---------+-----------");
569
                        HoTT_printfxy(0,3,"---------+-----------");
552
 
570
 
553
//                      HoTT_printfxy(0,3,"---------------------");
571
//                      HoTT_printfxy(0,3,"---------------------");
554
                        HoTT_printfxy(0,6,"---------------------");
572
                        HoTT_printfxy(0,6,"---------------------");
555
                        break;
573
                        break;
556
        case 4:  
574
        case 4:  
557
                        if(NaviDataOkay)
575
                        if(NaviDataOkay)
558
                        {
576
                        {
559
                                HoTT_printfxy(9,4,":");
577
                                HoTT_printfxy(9,4,":");
560
                                HoTT_printfxy(0,4,"SAT:%2d ",GPSInfo.NumOfSats);
578
                                HoTT_printfxy(0,4,"SAT:%2d ",GPSInfo.NumOfSats);
561
                            HoTT_printfxy(10,4,"DIST:%3dm",GPSInfo.HomeDistance/10);
579
                            HoTT_printfxy(10,4,"DIST:%3dm",GPSInfo.HomeDistance/10);
562
                                switch (GPSInfo.SatFix)
580
                                switch (GPSInfo.SatFix)
563
                                {
581
                                {
564
                                        case SATFIX_3D:
582
                                        case SATFIX_3D:
565
                                                        if(GPSInfo.Flags & FLAG_DIFFSOLN) HoTT_printfxy(7,4,"D ")
583
                                                        if(GPSInfo.Flags & FLAG_DIFFSOLN) HoTT_printfxy(7,4,"D ")
566
                                                        else HoTT_printfxy(7,4,"3D");
584
                                                        else HoTT_printfxy(7,4,"3D");
567
                                                break;
585
                                                break;
568
                                        default:
586
                                        default:
569
                                                HoTT_printfxy_BLINK(7,4,"!!");
587
                                                HoTT_printfxy_BLINK(7,4,"!!");
570
                                                break;
588
                                                break;
571
                                }      
589
                                }      
572
                        }
590
                        }
573
                        else
591
                        else
574
                        {                    
592
                        {                    
575
                                Hott_ClearLine(4);
593
                                Hott_ClearLine(4);
576
                        }
594
                        }
577
                        break;
595
                        break;
578
        case 5:
596
        case 5:
579
                        if(NaviDataOkay)
597
                        if(NaviDataOkay)
580
                        {
598
                        {
581
                        if(show_mag)
599
                        if(show_mag)
582
                          {
600
                          {
583
                                HoTT_printfxy(0,5,"MAG:%3u%% ",EarthMagneticField);
601
                                HoTT_printfxy(0,5,"MAG:%3u%% ",EarthMagneticField);
584
                            HoTT_printfxy(12,5,"HM:%3d%c %c", GPSInfo.HomeBearing, HoTT_GRAD, NC_GPS_ModeCharacter);
602
                            HoTT_printfxy(12,5,"HM:%3d%c %c", GPSInfo.HomeBearing, HoTT_GRAD, NC_GPS_ModeCharacter);
585
                                HoTT_printfxy(9,5,"incl:%2d%c(%2i)",EarthMagneticInclination, HoTT_GRAD,EarthMagneticInclinationTheoretic);
603
                                HoTT_printfxy(9,5,"incl:%2d%c(%2i)",EarthMagneticInclination, HoTT_GRAD,EarthMagneticInclinationTheoretic);
586
              }
604
              }
587
                         else
605
                         else
588
                          {
606
                          {
589
                                HoTT_printfxy(0,5,"    %2um/s:  HM:%3d%c %c",GPSInfo.Speed, GPSInfo.HomeBearing, HoTT_GRAD, NC_GPS_ModeCharacter);
607
                                HoTT_printfxy(0,5,"    %2um/s:  HM:%3d%c %c",GPSInfo.Speed, GPSInfo.HomeBearing, HoTT_GRAD, NC_GPS_ModeCharacter);
590
                          }    
608
                          }    
591
            }
609
            }
592
                        else Hott_ClearLine(5);
610
                        else Hott_ClearLine(5);
593
                        break;
611
                        break;
594
        case 6:
612
        case 6:
595
                        break;
613
                        break;
596
        case 7: if(NC_ErrorCode)
614
        case 7: if(NC_ErrorCode)
597
                  {
615
                  {
598
                           if(HoTTBlink && NC_ErrorCode < MAX_ERR_NUMBER)
616
                           if(HoTTBlink && NC_ErrorCode < MAX_ERR_NUMBER)
599
                            {
617
                            {
600
                             Hott_ClearLine(7);
618
                             Hott_ClearLine(7);
601
                             HoTT_printfxy_INV(0,7,"ERR: %2d !",NC_ErrorCode);
619
                             HoTT_printfxy_INV(0,7,"ERR: %2d !",NC_ErrorCode);
602
                            }
620
                            }
603
                                else
621
                                else
604
                                {
622
                                {
605
                                 HoTT_printfxy(0,7,"ERR: ");     _printf_P(&LIBFC_HoTT_Putchar, NC_ERROR_TEXT[NC_ErrorCode] , 0);};
623
                                 HoTT_printfxy(0,7,"ERR: ");     _printf_P(&LIBFC_HoTT_Putchar, NC_ERROR_TEXT[NC_ErrorCode] , 0);};
606
                                }
624
                                }
607
                        else
625
                        else
608
                        if(FC_StatusFlags & FC_STATUS_LOWBAT) HoTT_printfxy(1,7,"!! LiPo voltage !!")
626
                        if(FC_StatusFlags & FC_STATUS_LOWBAT) HoTT_printfxy(1,7,"!! LiPo voltage !!")
609
                        else HoTT_printfxy(0,7," www.MikroKopter.de  ");
627
                        else HoTT_printfxy(0,7," www.MikroKopter.de  ");
610
                        break;
628
                        break;
611
        case 8: //ASCIIPacket.WarnBeep = HoTT_Waring();
629
        case 8: //ASCIIPacket.WarnBeep = HoTT_Waring();
612
                        // ASCIIPacket.WarnBeep = Parameter_UserParam1;
630
                        // ASCIIPacket.WarnBeep = Parameter_UserParam1;
613
        case 9:
631
        case 9:
614
        case 10:
632
        case 10:
615
        case 11:
633
        case 11:
616
        case 12:
634
        case 12:
617
        case 13:
635
        case 13:
618
        case 14:  
636
        case 14:  
619
        case 15:  
637
        case 15:  
620
        case 16:  
638
        case 16:  
621
                        if(HottKeyboard == HOTT_KEY_DOWN) { LIBFC_HoTT_Clear(); page = 5; line = 0;}
639
                        if(HottKeyboard == HOTT_KEY_DOWN) { LIBFC_HoTT_Clear(); page = 5; line = 0;}
622
                        else
640
                        else
623
                        if(HottKeyboard == HOTT_KEY_SET) { if(show_mag) show_mag = 0; else show_mag = 1;}
641
                        if(HottKeyboard == HOTT_KEY_SET) { if(show_mag) show_mag = 0; else show_mag = 1;}
624
                        else
642
                        else
625
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page = 1; line = 0;};
643
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page = 1; line = 0;};
626
                        HottKeyboard = 0;
644
                        HottKeyboard = 0;
627
                        break;
645
                        break;
628
   default:  line = 0;
646
   default:  line = 0;
629
                        break;
647
                        break;
630
  }
648
  }
631
  break;
649
  break;
632
  case 1:
650
  case 1:
633
  switch(line++)
651
  switch(line++)
634
  {
652
  {
635
        case 0:  
653
        case 0:  
636
                if(FC_StatusFlags & FC_STATUS_LOWBAT)
654
                if(FC_StatusFlags & FC_STATUS_LOWBAT)
637
                         HoTT_printfxy_BLINK(0,0," %2i:%02i  %2i.%1iV %4imAh",FlugSekunden/60,FlugSekunden%60,UBat/10, UBat%10,Capacity.UsedCapacity)
655
                         HoTT_printfxy_BLINK(0,0," %2i:%02i  %2i.%1iV %4imAh",FlugSekunden/60,FlugSekunden%60,UBat/10, UBat%10,Capacity.UsedCapacity)
638
            else   HoTT_printfxy(0,0," %2i:%02i  %2i.%1iV %4imAh",FlugSekunden/60,FlugSekunden%60,UBat/10, UBat%10,Capacity.UsedCapacity);                         
656
            else   HoTT_printfxy(0,0," %2i:%02i  %2i.%1iV %4imAh",FlugSekunden/60,FlugSekunden%60,UBat/10, UBat%10,Capacity.UsedCapacity);                         
639
                        break;
657
                        break;
640
        case 1:  
658
        case 1:  
641
                        HoTT_printfxy(0,1,"DIR:%3d%c",CompassCorrected, HoTT_GRAD);
659
                        HoTT_printfxy(0,1,"DIR:%3d%c",CompassCorrected, HoTT_GRAD);
642
                        if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG)
660
                        if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG)
643
                          {
661
                          {
644
                           if(HoehenReglerAktiv)        HoTT_printfxy_INV(10,1,"ALT:%4im", (int16_t)(HoehenWert/100))
662
                           if(HoehenReglerAktiv)        HoTT_printfxy_INV(10,1,"ALT:%4im", (int16_t)(HoehenWert/100))
645
                           else                                         HoTT_printfxy(10,1,"ALT:%4im", (int16_t)(HoehenWert/100))
663
                           else                                         HoTT_printfxy(10,1,"ALT:%4im", (int16_t)(HoehenWert/100))
646
                           }
664
                           }
647
            else    HoTT_printfxy(10,1,"ALT:---- ");
665
            else    HoTT_printfxy(10,1,"ALT:---- ");
648
                        HoTT_printfxy(20,1,"%c",VarioCharacter);
666
                        HoTT_printfxy(20,1,"%c",VarioCharacter);
649
            break;
667
            break;
650
        case 2:
668
        case 2:
651
                        if(NaviDataOkay)
669
                        if(NaviDataOkay)
652
                        {
670
                        {
653
                          HoTT_printfxy(1,2,"HM:%3d%c  DIST:%3dm %c", GPSInfo.HomeBearing, HoTT_GRAD, GPSInfo.HomeDistance/10, NC_GPS_ModeCharacter);
671
                          HoTT_printfxy(1,2,"HM:%3d%c  DIST:%3dm %c", GPSInfo.HomeBearing, HoTT_GRAD, GPSInfo.HomeDistance/10, NC_GPS_ModeCharacter);
654
            }
672
            }
655
                        else
673
                        else
656
                        {
674
                        {
657
                         Hott_ClearLine(2);
675
                         Hott_ClearLine(2);
658
                        }
676
                        }
659
                        break;
677
                        break;
660
        case 3:
678
        case 3:
661
                        HoTT_printfxy(0,3,"PWR:%2i.%1iA (%iW) ",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10,Capacity.ActualPower);
679
                        HoTT_printfxy(0,3,"PWR:%2i.%1iA (%iW) ",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10,Capacity.ActualPower);
662
                        if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) HoTT_printfxy_INV(19,3,"CF") else HoTT_printfxy(19,3,"  ");
680
                        if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) HoTT_printfxy_INV(19,3,"CF") else HoTT_printfxy(19,3,"  ");
663
                        break;
681
                        break;
664
        case 4:  
682
        case 4:  
665
                        if(NaviDataOkay)
683
                        if(NaviDataOkay)
666
                        {
684
                        {
667
                                HoTT_printfxy(0,4,"GPS:%2um/s SAT:%d ",GPSInfo.Speed,GPSInfo.NumOfSats);
685
                                HoTT_printfxy(0,4,"GPS:%2um/s SAT:%d ",GPSInfo.Speed,GPSInfo.NumOfSats);
668
                                switch (GPSInfo.SatFix)
686
                                switch (GPSInfo.SatFix)
669
                                {
687
                                {
670
                                        case SATFIX_3D:
688
                                        case SATFIX_3D:
671
                                                HoTT_printfxy(16,4,"  3D ");
689
                                                HoTT_printfxy(16,4,"  3D ");
672
                                                break;
690
                                                break;
673
                                        //case SATFIX_2D:
691
                                        //case SATFIX_2D:
674
                                        //case SATFIX_NONE:
692
                                        //case SATFIX_NONE:
675
                                        default:
693
                                        default:
676
                                                HoTT_printfxy_BLINK(16,4,"NOFIX");
694
                                                HoTT_printfxy_BLINK(16,4,"NOFIX");
677
                                                break;
695
                                                break;
678
                                }      
696
                                }      
679
                                if(GPSInfo.Flags & FLAG_DIFFSOLN)
697
                                if(GPSInfo.Flags & FLAG_DIFFSOLN)
680
                                {
698
                                {
681
                                        HoTT_printfxy(16,4,"DGPS ");
699
                                        HoTT_printfxy(16,4,"DGPS ");
682
                                }
700
                                }
683
                        }
701
                        }
684
                        else
702
                        else
685
                        {                    //012345678901234567890
703
                        {                    //012345678901234567890
686
                                HoTT_printfxy(0,4,"   No NaviCtrl       ");
704
                                HoTT_printfxy(0,4,"   No NaviCtrl       ");
687
                        }
705
                        }
688
                        break;
706
                        break;
689
        case 5:
707
        case 5:
690
                        if(show_current)
708
                        if(show_current)
691
                         {
709
                         {
692
//                              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);
710
//                              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);
693
                                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);
711
                                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);
694
                         }
712
                         }
695
                         else
713
                         else
696
                         {
714
                         {
697
                                HoTT_printfxy(0,5,"%3i %3i %3i %3i%cC", Motor[0].Temperature, Motor[1].Temperature, Motor[2].Temperature, Motor[3].Temperature,HoTT_GRAD);
715
                                HoTT_printfxy(0,5,"%3i %3i %3i %3i%cC", Motor[0].Temperature, Motor[1].Temperature, Motor[2].Temperature, Motor[3].Temperature,HoTT_GRAD);
698
                         }
716
                         }
699
                        break;
717
                        break;
700
        case 6:
718
        case 6:
701
                        if(show_current)
719
                        if(show_current)
702
                         {
720
                         {
703
                    if(RequiredMotors == 4) Hott_ClearLine(6);
721
                    if(RequiredMotors == 4) Hott_ClearLine(6);
704
                                else
722
                                else
705
//                              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)
723
//                              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)
706
                                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)
724
                                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)
707
                                else
725
                                else
708
//                              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);
726
//                              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);
709
                                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);
727
                                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);
710
             }
728
             }
711
                         else
729
                         else
712
                         {
730
                         {
713
                    if(RequiredMotors == 4) Hott_ClearLine(6);
731
                    if(RequiredMotors == 4) Hott_ClearLine(6);
714
                                else
732
                                else
715
                                if(RequiredMotors == 6)  HoTT_printfxy(0,6,"%3i %3i%cC        ", Motor[4].Temperature, Motor[5].Temperature,HoTT_GRAD)
733
                                if(RequiredMotors == 6)  HoTT_printfxy(0,6,"%3i %3i%cC        ", Motor[4].Temperature, Motor[5].Temperature,HoTT_GRAD)
716
                                else
734
                                else
717
                                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);
735
                                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);
718
             }
736
             }
719
                        break;
737
                        break;
720
        case 7: if(NC_ErrorCode)
738
        case 7: if(NC_ErrorCode)
721
                  {
739
                  {
722
                           if(HoTTBlink && NC_ErrorCode < MAX_ERR_NUMBER)
740
                           if(HoTTBlink && NC_ErrorCode < MAX_ERR_NUMBER)
723
                            {
741
                            {
724
                             Hott_ClearLine(7);
742
                             Hott_ClearLine(7);
725
                             HoTT_printfxy_INV(0,7,"ERR: %2d !",NC_ErrorCode);
743
                             HoTT_printfxy_INV(0,7,"ERR: %2d !",NC_ErrorCode);
726
                            }
744
                            }
727
                                else
745
                                else
728
                                {
746
                                {
729
                                 HoTT_printfxy(0,7,"ERR: ");     _printf_P(&LIBFC_HoTT_Putchar, NC_ERROR_TEXT[NC_ErrorCode] , 0);};
747
                                 HoTT_printfxy(0,7,"ERR: ");     _printf_P(&LIBFC_HoTT_Putchar, NC_ERROR_TEXT[NC_ErrorCode] , 0);};
730
                                }
748
                                }
731
                        else
749
                        else
732
                        if(FC_StatusFlags & FC_STATUS_LOWBAT) HoTT_printfxy(1,7,"!! LiPo voltage !!")
750
                        if(FC_StatusFlags & FC_STATUS_LOWBAT) HoTT_printfxy(1,7,"!! LiPo voltage !!")
733
                        else HoTT_printfxy(0,7," www.MikroKopter.de  ");
751
                        else HoTT_printfxy(0,7," www.MikroKopter.de  ");
734
                        break;
752
                        break;
735
        case 8: // ASCIIPacket.WarnBeep = HoTT_Waring();
753
        case 8: // ASCIIPacket.WarnBeep = HoTT_Waring();
736
                        // ASCIIPacket.WarnBeep = Parameter_UserParam1;
754
                        // ASCIIPacket.WarnBeep = Parameter_UserParam1;
737
        case 9:
755
        case 9:
738
        case 10:
756
        case 10:
739
        case 11:
757
        case 11:
740
        case 12:
758
        case 12:
741
        case 13:
759
        case 13:
742
        case 14:  
760
        case 14:  
743
        case 15:  
761
        case 15:  
744
        case 16:  
762
        case 16:  
745
                        if(HottKeyboard == HOTT_KEY_SET) { if(show_current) show_current = 0; else show_current = 1;   Hott_ClearLine(5);  Hott_ClearLine(6);}
763
                        if(HottKeyboard == HOTT_KEY_SET) { if(show_current) show_current = 0; else show_current = 1;   Hott_ClearLine(5);  Hott_ClearLine(6);}
746
                        else
764
                        else
747
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page = 2; line = 0;}
765
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page = 2; line = 0;}
748
                        else
766
                        else
749
                        if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page = 0; line = 0;}
767
                        if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page = 0; line = 0;}
750
//if(HottKeyboard) HoTT_printfxy(15,6,"%KEY:%02x ",HottKeyboard);
768
//if(HottKeyboard) HoTT_printfxy(15,6,"%KEY:%02x ",HottKeyboard);
751
                        HottKeyboard = 0;
769
                        HottKeyboard = 0;
752
                        break;
770
                        break;
753
   default:  line = 0;
771
   default:  line = 0;
754
                        break;
772
                        break;
755
  }
773
  }
756
  break;
774
  break;
757
  case 2:
775
  case 2:
758
  switch(line++)
776
  switch(line++)
759
  {
777
  {
760
        case 0:  
778
        case 0:  
761
                        HoTT_printfxy_INV(0,0,"Setting:%u %s ",ActiveParamSet,EE_Parameter.Name);
779
                        HoTT_printfxy_INV(0,0,"Setting:%u %s ",ActiveParamSet,EE_Parameter.Name);
762
                        break;
780
                        break;
763
    case 1: HoTT_printfxy(0,1,"Min:%2i.%1iV %s ",BattLowVoltageWarning/10, BattLowVoltageWarning%10, Mixer.Name);
781
    case 1: HoTT_printfxy(0,1,"Min:%2i.%1iV %s ",BattLowVoltageWarning/10, BattLowVoltageWarning%10, Mixer.Name);
764
                        break;
782
                        break;
765
    case 2:  HoTT_printfxy(0,2,"ALT:");
783
    case 2:  HoTT_printfxy(0,2,"ALT:");
766
                 if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG)
784
                 if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG)
767
                 {
785
                 {
768
                          if(!(EE_Parameter.GlobalConfig & CFG_HOEHEN_SCHALTER)) HoTT_printf("POTI:%3u ", Parameter_HoehenSchalter)
786
                          if(!(EE_Parameter.GlobalConfig & CFG_HOEHEN_SCHALTER)) HoTT_printf("POTI:%3u ", Parameter_HoehenSchalter)
769
                          else
787
                          else
770
                          {
788
                          {
771
                           if(Parameter_HoehenSchalter > 50) HoTT_printf("(ON)  ") else HoTT_printf("(OFF) ");
789
                           if(Parameter_HoehenSchalter > 50) HoTT_printf("(ON)  ") else HoTT_printf("(OFF) ");
772
                           if((Parameter_ExtraConfig & CFG2_HEIGHT_LIMIT)) HoTT_printf("LIMIT", Parameter_HoehenSchalter)
790
                           if((Parameter_ExtraConfig & CFG2_HEIGHT_LIMIT)) HoTT_printf("LIMIT", Parameter_HoehenSchalter)
773
                           else HoTT_printf("VARIO", Parameter_HoehenSchalter);
791
                           else HoTT_printf("VARIO", Parameter_HoehenSchalter);
774
                          }
792
                          }
775
                         }
793
                         }
776
                        else
794
                        else
777
                                HoTT_printf("DISABLED");
795
                                HoTT_printf("DISABLED");
778
                        break;
796
                        break;
779
    case 3: HoTT_printfxy(0,3,"CF:");
797
    case 3: HoTT_printfxy(0,3,"CF:");
780
                        if(!EE_Parameter.CareFreeChannel) HoTT_printf("DISABLED")
798
                        if(!EE_Parameter.CareFreeChannel) HoTT_printf("DISABLED")
781
                        else
799
                        else
782
                         {
800
                         {
783
                          if(CareFree)  HoTT_printf(" (ON) ") else HoTT_printf(" (OFF)");
801
                          if(CareFree)  HoTT_printf(" (ON) ") else HoTT_printf(" (OFF)");
784
                          if(EE_Parameter.ExtraConfig & CFG_LEARNABLE_CAREFREE) HoTT_printf(" TEACH");
802
                          if(EE_Parameter.ExtraConfig & CFG_LEARNABLE_CAREFREE) HoTT_printf(" TEACH");
785
                         }
803
                         }
786
                        break;
804
                        break;
787
    case 4: HoTT_printfxy(0,4,"GPS:");
805
    case 4: HoTT_printfxy(0,4,"GPS:");
788
                    if(!(Parameter_GlobalConfig & CFG_GPS_AKTIV)) HoTT_printf("DISABLED")
806
                    if(!(Parameter_GlobalConfig & CFG_GPS_AKTIV)) HoTT_printf("DISABLED")
789
                        else
807
                        else
790
                         {
808
                         {
791
                          tmp = GetChannelValue(EE_Parameter.NaviGpsModeChannel);
809
                          tmp = GetChannelValue(EE_Parameter.NaviGpsModeChannel);
792
                          if(tmp < 50) HoTT_printf("(FREE)")
810
                          if(tmp < 50) HoTT_printf("(FREE)")
793
                          else
811
                          else
794
                          if(tmp >= 180) HoTT_printf("(HOME)")
812
                          if(tmp >= 180) HoTT_printf("(HOME)")
795
                          else
813
                          else
796
                          if(EE_Parameter.ExtraConfig & CFG_GPS_AID) HoTT_printf("(AID) ")
814
                          if(EE_Parameter.ExtraConfig & CFG_GPS_AID) HoTT_printf("(AID) ")
797
                          else HoTT_printf("(HOLD)")
815
                          else HoTT_printf("(HOLD)")
798
                         }
816
                         }
799
                        if(EE_Parameter.FailSafeTime) HoTT_printfxy(10,4," FS:%usek ",EE_Parameter.FailSafeTime)
817
                        if(EE_Parameter.FailSafeTime) HoTT_printfxy(10,4," FS:%usek ",EE_Parameter.FailSafeTime)
800
 
818
 
801
                        break;
819
                        break;
802
    case 5: HoTT_printfxy(0,5,"HOME ALT:");
820
    case 5: HoTT_printfxy(0,5,"HOME ALT:");
803
                        if(EE_Parameter.ComingHomeAltitude) HoTT_printf("%um",EE_Parameter.ComingHomeAltitude) else HoTT_printf("HOLD ");
821
                        if(EE_Parameter.ComingHomeAltitude) HoTT_printf("%um",EE_Parameter.ComingHomeAltitude) else HoTT_printf("HOLD ");
804
                        break;
822
                        break;
805
        case 6:
823
        case 6:
806
                        if(!show_poti)
824
                        if(!show_poti)
807
                         {
825
                         {
808
              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);
826
              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);
809
                      HoTT_printfxy(0,7,"Gs:%4i Ya:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_GAS]]+127,PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]);
827
                      HoTT_printfxy(0,7,"Gs:%4i Ya:%4i ",PPM_in[EE_Parameter.Kanalbelegung[K_GAS]]+127,PPM_in[EE_Parameter.Kanalbelegung[K_GIER]]);
810
                         }
828
                         }
811
                        else
829
                        else
812
                         {
830
                         {
813
              HoTT_printfxy(0,6,"P1:%4i P2:%4i 3:%3i",Poti1,Poti2, Poti3);
831
              HoTT_printfxy(0,6,"P1:%4i P2:%4i 3:%3i",Poti1,Poti2, Poti3);
814
                      HoTT_printfxy(0,7,"P4:%4i P5:%4i 6:%3i",Poti4,Poti5, Poti6);
832
                      HoTT_printfxy(0,7,"P4:%4i P5:%4i 6:%3i",Poti4,Poti5, Poti6);
815
                         }
833
                         }
816
 
834
 
817
                        break;
835
                        break;
818
    case 7: //HoTT_printfxy(0,6,"WARNINGS:");
836
    case 7: //HoTT_printfxy(0,6,"WARNINGS:");
819
                        if(HoTTBlink)
837
                        if(HoTTBlink)
820
                        {
838
                        {
821
                         LIBFC_HoTT_SetPos(6 * 21);
839
                         LIBFC_HoTT_SetPos(6 * 21);
822
                         if(!(Parameter_GlobalConfig & CFG_ACHSENKOPPLUNG_AKTIV)) HoTT_printf_BLINK("COUPLING OFF! ");
840
                         if(!(Parameter_GlobalConfig & CFG_ACHSENKOPPLUNG_AKTIV)) HoTT_printf_BLINK("COUPLING OFF! ");
823
                         if(EE_Parameter.BitConfig & (CFG_LOOP_LINKS | CFG_LOOP_RECHTS | CFG_LOOP_UNTEN | CFG_LOOP_OBEN)) HoTT_printf_BLINK("LOOPING! ");
841
                         if(EE_Parameter.BitConfig & (CFG_LOOP_LINKS | CFG_LOOP_RECHTS | CFG_LOOP_UNTEN | CFG_LOOP_OBEN)) HoTT_printf_BLINK("LOOPING! ");
824
                         if(Parameter_GlobalConfig & CFG_HEADING_HOLD) HoTT_printf_BLINK("HH! ");
842
                         if(Parameter_GlobalConfig & CFG_HEADING_HOLD) HoTT_printf_BLINK("HH! ");
825
                         if(!(Parameter_GlobalConfig & CFG_KOMPASS_AKTIV)) HoTT_printf_BLINK("COMPASS OFF! ");
843
                         if(!(Parameter_GlobalConfig & CFG_KOMPASS_AKTIV)) HoTT_printf_BLINK("COMPASS OFF! ");
826
                        }
844
                        }
827
                        break;
845
                        break;
828
    case 8: //ASCIIPacket.WarnBeep = HoTT_Waring();
846
    case 8: //ASCIIPacket.WarnBeep = HoTT_Waring();
829
                        break;
847
                        break;
830
    case 9:
848
    case 9:
831
    case 10:
849
    case 10:
832
    case 11:
850
    case 11:
833
    case 12:
851
    case 12:
834
    case 13:
852
    case 13:
835
    case 14:
853
    case 14:
836
    case 15:
854
    case 15:
837
    case 16:
855
    case 16:
838
                        if(HottKeyboard == HOTT_KEY_SET) { if(show_poti) show_poti = 0; else show_poti = 1;   Hott_ClearLine(6);  Hott_ClearLine(7);}
856
                        if(HottKeyboard == HOTT_KEY_SET) { if(show_poti) show_poti = 0; else show_poti = 1;   Hott_ClearLine(6);  Hott_ClearLine(7);}
839
                        else
857
                        else
840
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page = 3; line = 0;}
858
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page = 3; line = 0;}
841
                        else
859
                        else
842
                        if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page = 1; line = 0;};
860
                        if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page = 1; line = 0;};
843
                        HottKeyboard = 0;
861
                        HottKeyboard = 0;
844
                        break;
862
                        break;
845
   default:  line = 0;
863
   default:  line = 0;
846
                        break;
864
                        break;
847
  }
865
  }
848
  break;
866
  break;
849
  case 3:
867
  case 3:
850
  switch(line++)
868
  switch(line++)
851
  {
869
  {
852
        static unsigned char load_waypoint_tmp2 = 1, changed2;
870
        static unsigned char load_waypoint_tmp2 = 1, changed2;
853
        case 0:  
871
        case 0:  
854
                        HoTT_printfxy(0,0,"Load Waypoints");
872
                        HoTT_printfxy(0,0,"Load Waypoints");
855
                        HoTT_printfxy(0,1,"(Relative Positions)");
873
                        HoTT_printfxy(0,1,"(Relative Positions)");
856
//                      HoTT_printfxy(0,1,"(Absolute)"); 
874
//                      HoTT_printfxy(0,1,"(Absolute)"); 
857
                        break;
875
                        break;
858
    case 1:
876
    case 1:
859
                        if(NaviData_WaypointNumber)     HoTT_printfxy(0,6,"Active WP:%2d/%d ",NaviData_WaypointIndex,NaviData_WaypointNumber)
877
                        if(NaviData_WaypointNumber)     HoTT_printfxy(0,6,"Active WP:%2d/%d ",NaviData_WaypointIndex,NaviData_WaypointNumber)
860
                        else HoTT_printfxy(0,6,"No WPs active     ")
878
                        else HoTT_printfxy(0,6,"No WPs active     ")
861
                        break;
879
                        break;
862
    case 2:
880
    case 2:
863
                         HoTT_printfxy(0,7,"%2i.%1iV ",UBat/10, UBat%10)
881
                         HoTT_printfxy(0,7,"%2i.%1iV ",UBat/10, UBat%10)
864
                         HoTT_printfxy(11,7,"%s",WPL_Name)
882
                         HoTT_printfxy(11,7,"%s",WPL_Name)
865
    case 3:
883
    case 3:
866
    case 4:
884
    case 4:
867
    case 5:
885
    case 5:
868
                        if(load_waypoint_tmp2)
886
                        if(load_waypoint_tmp2)
869
                         {
887
                         {
870
                          if(changed2 && HoTTBlink) HoTT_printfxy(10,3,"   ")
888
                          if(changed2 && HoTTBlink) HoTT_printfxy(10,3,"   ")
871
                          else HoTT_printfxy(10,3,"%2i   ",load_waypoint_tmp2);
889
                          else HoTT_printfxy(10,3,"%2i   ",load_waypoint_tmp2);
872
                          HoTT_printfxy(0,3,"Load list:")
890
                          HoTT_printfxy(0,3,"Load list:")
873
                         }
891
                         }
874
                        else
892
                        else
875
                         {
893
                         {
876
                          HoTT_printfxy(0,3,"Load list: -- ");
894
                          HoTT_printfxy(0,3,"Load list: -- ");
877
                         }
895
                         }
878
                         if(NaviData_MaxWpListIndex == 0) HoTT_printfxy(0,4,"No SD-Card   ")
896
                         if(NaviData_MaxWpListIndex == 0) HoTT_printfxy(0,4,"No SD-Card   ")
879
                         else
897
                         else
880
                         {
898
                         {
881
                          if(GPSInfo.SatFix == SATFIX_3D)
899
                          if(GPSInfo.SatFix == SATFIX_3D)
882
                           {
900
                           {
883
                            if(changed2 && load_waypoint_tmp2) HoTT_printfxy(0,4,"(Set -> Load)")
901
                            if(changed2 && load_waypoint_tmp2) HoTT_printfxy(0,4,"(Set -> Load)")
884
                            else HoTT_printfxy(0,4,"             ");
902
                            else HoTT_printfxy(0,4,"             ");
885
                                if(HottKeyboard == HOTT_KEY_SET) { if(load_waypoint_tmp2) ToNC_Load_WP_List = load_waypoint_tmp2 | 128; changed2 = 0;}
903
                                if(HottKeyboard == HOTT_KEY_SET) { if(load_waypoint_tmp2) ToNC_Load_WP_List = load_waypoint_tmp2 | 128; changed2 = 0;}
886
                           } else HoTT_printfxy(0,4,"!No GPS-Fix! ");
904
                           } else HoTT_printfxy(0,4,"!No GPS-Fix! ");
887
                         }
905
                         }
888
                        if(HottKeyboard == HOTT_KEY_UP && load_waypoint_tmp2 < NaviData_MaxWpListIndex) { changed2 = 1; load_waypoint_tmp2++;HoTTBlink = 0;}
906
                        if(HottKeyboard == HOTT_KEY_UP && load_waypoint_tmp2 < NaviData_MaxWpListIndex) { changed2 = 1; load_waypoint_tmp2++;HoTTBlink = 0;}
889
                        if(HottKeyboard == HOTT_KEY_DOWN && load_waypoint_tmp2 > 1) { changed2 = 1; load_waypoint_tmp2--;HoTTBlink = 0;};
907
                        if(HottKeyboard == HOTT_KEY_DOWN && load_waypoint_tmp2 > 1) { changed2 = 1; load_waypoint_tmp2--;HoTTBlink = 0;};
890
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page = 4; line = 0;}
908
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page = 4; line = 0;}
891
                        if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page = 2; line = 0;};
909
                        if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page = 2; line = 0;};
892
                        HottKeyboard = 0;
910
                        HottKeyboard = 0;
893
                        break;
911
                        break;
894
   default:  line = 0;
912
   default:  line = 0;
895
                        break;
913
                        break;
896
  }
914
  }
897
  break;
915
  break;
898
  case 4:
916
  case 4:
899
  switch(line++)
917
  switch(line++)
900
  {
918
  {
901
        static unsigned char load_waypoint_tmp = 1, changed;
919
        static unsigned char load_waypoint_tmp = 1, changed;
902
        case 0:  
920
        case 0:  
903
                        HoTT_printfxy(0,0,"Load Waypoints");
921
                        HoTT_printfxy(0,0,"Load Waypoints");
904
                        HoTT_printfxy(0,1,"(Fixed Positions)");
922
                        HoTT_printfxy(0,1,"(Fixed Positions)");
905
                        break;
923
                        break;
906
    case 1:
924
    case 1:
907
                        if(NaviData_WaypointNumber)     HoTT_printfxy(0,6,"Active WP:%2d/%d ",NaviData_WaypointIndex,NaviData_WaypointNumber)
925
                        if(NaviData_WaypointNumber)     HoTT_printfxy(0,6,"Active WP:%2d/%d ",NaviData_WaypointIndex,NaviData_WaypointNumber)
908
                        else HoTT_printfxy(0,6,"No WPs active    ")
926
                        else HoTT_printfxy(0,6,"No WPs active    ")
909
                        break;
927
                        break;
910
    case 2:
928
    case 2:
911
                         HoTT_printfxy(0,7,"%2i.%1iV ",UBat/10, UBat%10)
929
                         HoTT_printfxy(0,7,"%2i.%1iV ",UBat/10, UBat%10)
912
                         HoTT_printfxy(11,7,"%s",WPL_Name)
930
                         HoTT_printfxy(11,7,"%s",WPL_Name)
913
    case 3:
931
    case 3:
914
    case 4:
932
    case 4:
915
    case 5:
933
    case 5:
916
                        HoTT_printfxy(0,3,"Load list:")
934
                        HoTT_printfxy(0,3,"Load list:")
917
                        if(load_waypoint_tmp)
935
                        if(load_waypoint_tmp)
918
                         {
936
                         {
919
                          if(changed && HoTTBlink) HoTT_printfxy(10,3,"   ")
937
                          if(changed && HoTTBlink) HoTT_printfxy(10,3,"   ")
920
                          else HoTT_printfxy(10,3,"%2d (FIX)",load_waypoint_tmp);
938
                          else HoTT_printfxy(10,3,"%2d (FIX)",load_waypoint_tmp);
921
                         }
939
                         }
922
                        else
940
                        else
923
                         {
941
                         {
924
                          HoTT_printfxy(10,3," --")
942
                          HoTT_printfxy(10,3," --")
925
                         }
943
                         }
926
                       
944
                       
927
                         if(NaviData_MaxWpListIndex == 0) HoTT_printfxy(0,4,"No SD-Card   ")
945
                         if(NaviData_MaxWpListIndex == 0) HoTT_printfxy(0,4,"No SD-Card   ")
928
                         else
946
                         else
929
                         {
947
                         {
930
                            if(changed && load_waypoint_tmp) HoTT_printfxy(0,4,"(Set -> Load)")
948
                            if(changed && load_waypoint_tmp) HoTT_printfxy(0,4,"(Set -> Load)")
931
                            else HoTT_printfxy(0,4,"             ");
949
                            else HoTT_printfxy(0,4,"             ");
932
                         }
950
                         }
933
                        if(HottKeyboard == HOTT_KEY_UP && load_waypoint_tmp < NaviData_MaxWpListIndex) { changed = 1; load_waypoint_tmp++; HoTTBlink = 0;}
951
                        if(HottKeyboard == HOTT_KEY_UP && load_waypoint_tmp < NaviData_MaxWpListIndex) { changed = 1; load_waypoint_tmp++; HoTTBlink = 0;}
934
                        if(HottKeyboard == HOTT_KEY_DOWN && load_waypoint_tmp > 1) { changed = 1; load_waypoint_tmp--; HoTTBlink = 0;};
952
                        if(HottKeyboard == HOTT_KEY_DOWN && load_waypoint_tmp > 1) { changed = 1; load_waypoint_tmp--; HoTTBlink = 0;};
935
                        if(HottKeyboard == HOTT_KEY_SET) { if(load_waypoint_tmp) ToNC_Load_WP_List = load_waypoint_tmp; changed = 0;}
953
                        if(HottKeyboard == HOTT_KEY_SET) { if(load_waypoint_tmp) ToNC_Load_WP_List = load_waypoint_tmp; changed = 0;}
936
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;}
954
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;}
937
                        if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;};
955
                        if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;};
938
                        HottKeyboard = 0;
956
                        HottKeyboard = 0;
939
                        break;
957
                        break;
940
   default:  line = 0;
958
   default:  line = 0;
941
                        break;
959
                        break;
942
  }
960
  }
943
  break;
961
  break;
944
  case 5:
962
  case 5:
945
  switch(line++)
963
  switch(line++)
946
  {
964
  {
947
    static unsigned char wp_tmp, changed;
965
    static unsigned char wp_tmp, changed;
948
        case 0:  
966
        case 0:  
949
                        HoTT_printfxy(0,0,"Store single Position");
967
                        HoTT_printfxy(0,0,"Store single Position");
950
//                      HoTT_printfxy(0,1,"(Fixed Positions)"); 
968
//                      HoTT_printfxy(0,1,"(Fixed Positions)"); 
951
                        break;
969
                        break;
952
    case 1:
970
    case 1:
953
                    HoTT_printfxy(0,2," %2i.%1iV ",UBat/10, UBat%10)
971
                    HoTT_printfxy(0,2," %2i.%1iV ",UBat/10, UBat%10)
954
                        HoTT_printfxy(0,3," %2i:%02i ",FlugSekunden/60,FlugSekunden%60);                           
972
                        HoTT_printfxy(0,3," %2i:%02i ",FlugSekunden/60,FlugSekunden%60);                           
955
//                      HoTT_printfxy(0,4,"Dist:%3dm",NaviData_TargetDistance)
973
//                      HoTT_printfxy(0,4,"Dist:%3dm",NaviData_TargetDistance)
956
                        break;
974
                        break;
957
    case 2:
975
    case 2:
958
                        HoTT_printfxy(11,2,"ALT:%4im", (int16_t)(HoehenWert/100))              
976
                        HoTT_printfxy(11,2,"ALT:%4im", (int16_t)(HoehenWert/100))              
959
                        HoTT_printfxy(11,3,"DIR: %3d%c",CompassCorrected, HoTT_GRAD);
977
                        HoTT_printfxy(11,3,"DIR: %3d%c",CompassCorrected, HoTT_GRAD);
960
                        HoTT_printfxy(11,4,"Cam: %3i",Parameter_ServoNickControl);
978
                        HoTT_printfxy(11,4,"Cam: %3i",Parameter_ServoNickControl);
961
                        break;
979
                        break;
962
    case 3:
980
    case 3:
963
    case 4:
981
    case 4:
964
    case 5:
982
    case 5:
965
                    HoTT_printfxy(0,6,"Store point:")
983
                    HoTT_printfxy(0,6,"Store point:")
966
                        if(wp_tmp)
984
                        if(wp_tmp)
967
                         {
985
                         {
968
                          if(changed && HoTTBlink) HoTT_printfxy(13,6,"   ")
986
                          if(changed && HoTTBlink) HoTT_printfxy(13,6,"   ")
969
                          else HoTT_printfxy(13,6,"%2d ",wp_tmp);
987
                          else HoTT_printfxy(13,6,"%2d ",wp_tmp);
970
                         }
988
                         }
971
                        else
989
                        else
972
                         {
990
                         {
973
                          HoTT_printfxy(13,6,"--")
991
                          HoTT_printfxy(13,6,"--")
974
                         }
992
                         }
975
                       
993
                       
976
                    if(GPSInfo.SatFix == SATFIX_3D)
994
                    if(GPSInfo.SatFix == SATFIX_3D)
977
                    {
995
                    {
978
                         if(NaviData_MaxWpListIndex == 0) HoTT_printfxy(0,7,"No SD-Card   ")
996
                         if(NaviData_MaxWpListIndex == 0) HoTT_printfxy(0,7,"No SD-Card   ")
979
                         else
997
                         else
980
                         {
998
                         {
981
                            if(changed && wp_tmp) HoTT_printfxy(0,7,"(Set -> Store)")
999
                            if(changed && wp_tmp) HoTT_printfxy(0,7,"(Set -> Store)")
982
                            else Hott_ClearLine(7);
1000
                            else Hott_ClearLine(7);
983
                         }
1001
                         }
984
                         if(HottKeyboard == HOTT_KEY_SET) { if(wp_tmp) ToNC_Store_SingePoint = wp_tmp; changed = 0;}
1002
                         if(HottKeyboard == HOTT_KEY_SET) { if(wp_tmp) ToNC_Store_SingePoint = wp_tmp; changed = 0;}
985
                    }
1003
                    }
986
            else HoTT_printfxy(0,7,"!No GPS-Fix! ");
1004
            else HoTT_printfxy(0,7,"!No GPS-Fix! ");
987
                       
1005
                       
988
                        if(HottKeyboard == HOTT_KEY_UP && wp_tmp < NaviData_MaxWpListIndex) { changed = 1; wp_tmp++; HoTTBlink = 0;}
1006
                        if(HottKeyboard == HOTT_KEY_UP && wp_tmp < NaviData_MaxWpListIndex) { changed = 1; wp_tmp++; HoTTBlink = 0;}
989
                        if(HottKeyboard == HOTT_KEY_DOWN && wp_tmp > 1) { changed = 1; wp_tmp--; HoTTBlink = 0;};
1007
                        if(HottKeyboard == HOTT_KEY_DOWN && wp_tmp > 1) { changed = 1; wp_tmp--; HoTTBlink = 0;};
990
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;}
1008
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;}
991
                        if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;};
1009
                        if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;};
992
                        HottKeyboard = 0;
1010
                        HottKeyboard = 0;
993
                        break;
1011
                        break;
994
   default:  line = 0;
1012
   default:  line = 0;
995
                        break;
1013
                        break;
996
  }
1014
  }
997
  break;
1015
  break;
998
  case 6:
1016
  case 6:
999
  switch(line++)
1017
  switch(line++)
1000
  {
1018
  {
1001
    static unsigned char wp_tmp, changed;
1019
    static unsigned char wp_tmp, changed;
1002
        case 0:  
1020
        case 0:  
1003
                        HoTT_printfxy(0,0,"Load single Position");
1021
                        HoTT_printfxy(0,0,"Load single Position");
1004
//                      HoTT_printfxy(0,1,"(Fixed Positions)"); 
1022
//                      HoTT_printfxy(0,1,"(Fixed Positions)"); 
1005
                        break;
1023
                        break;
1006
    case 1:
1024
    case 1:
1007
                    HoTT_printfxy(0,2," %2i.%1iV ",UBat/10, UBat%10)
1025
                    HoTT_printfxy(0,2," %2i.%1iV ",UBat/10, UBat%10)
1008
                        HoTT_printfxy(0,3," %2i:%02i ",FlugSekunden/60,FlugSekunden%60);                           
1026
                        HoTT_printfxy(0,3," %2i:%02i ",FlugSekunden/60,FlugSekunden%60);                           
1009
//                      HoTT_printfxy(0,4,"Dist:%3dm",NaviData_TargetDistance)
1027
//                      HoTT_printfxy(0,4,"Dist:%3dm",NaviData_TargetDistance)
1010
                    if(NaviData_WaypointNumber) HoTT_printfxy(0,5,"WP:%2d/%d Dist:%3dm ",NaviData_WaypointIndex,NaviData_WaypointNumber,NaviData_TargetDistance)
1028
                    if(NaviData_WaypointNumber) HoTT_printfxy(0,5,"WP:%2d/%d Dist:%3dm ",NaviData_WaypointIndex,NaviData_WaypointNumber,NaviData_TargetDistance)
1011
                    else Hott_ClearLine(5);
1029
                    else Hott_ClearLine(5);
1012
                        break;
1030
                        break;
1013
    case 2:
1031
    case 2:
1014
                        if(FromNC_AltitudeSpeed)
1032
                        if(FromNC_AltitudeSpeed)
1015
                          HoTT_printfxy(8,2,"ALT:%4i/%im ", (int16_t)(HoehenWert/100),(int16_t)(FromNC_AltitudeSetpoint/100))
1033
                          HoTT_printfxy(8,2,"ALT:%4i/%im ", (int16_t)(HoehenWert/100),(int16_t)(FromNC_AltitudeSetpoint/100))
1016
                        else
1034
                        else
1017
                          HoTT_printfxy(8,2,"ALT:%4im    ",(int16_t)(HoehenWert/100))
1035
                          HoTT_printfxy(8,2,"ALT:%4im    ",(int16_t)(HoehenWert/100))
1018
 
1036
 
1019
                        HoTT_printfxy(8,3,"DIR: %3d%c",CompassCorrected, HoTT_GRAD);
1037
                        HoTT_printfxy(8,3,"DIR: %3d%c",CompassCorrected, HoTT_GRAD);
1020
                        HoTT_printfxy(8,4,"Cam: %3i",Parameter_ServoNickControl);
1038
                        HoTT_printfxy(8,4,"Cam: %3i",Parameter_ServoNickControl);
1021
                        break;
1039
                        break;
1022
//                       HoTT_printfxy(11,7,"%s",WPL_Name)
1040
//                       HoTT_printfxy(11,7,"%s",WPL_Name)
1023
    case 3:
1041
    case 3:
1024
    case 4:                                      
1042
    case 4:                                      
1025
    case 5:
1043
    case 5:
1026
                  if(HottKeyboard) DebugOut.Analog[17]++;
1044
                  if(HottKeyboard) DebugOut.Analog[17]++;
1027
                  HoTT_printfxy(0,6,"load point:")
1045
                  HoTT_printfxy(0,6,"load point:")
1028
                        if(wp_tmp)
1046
                        if(wp_tmp)
1029
                         {
1047
                         {
1030
                          if(changed && HoTTBlink) HoTT_printfxy(11,6,"   ")
1048
                          if(changed && HoTTBlink) HoTT_printfxy(11,6,"   ")
1031
                          else HoTT_printfxy(11,6,"%2d",wp_tmp);
1049
                          else HoTT_printfxy(11,6,"%2d",wp_tmp);
1032
                         }
1050
                         }
1033
                        else
1051
                        else
1034
                         {
1052
                         {
1035
                          HoTT_printfxy(11,6,"--")
1053
                          HoTT_printfxy(11,6,"--")
1036
                         }
1054
                         }
1037
                       
1055
                       
1038
                         if(NaviData_MaxWpListIndex == 0) HoTT_printfxy(0,7,"No SD-Card   ")
1056
                         if(NaviData_MaxWpListIndex == 0) HoTT_printfxy(0,7,"No SD-Card   ")
1039
                         else
1057
                         else
1040
                         {
1058
                         {
1041
                            if(changed && wp_tmp) HoTT_printfxy(0,7,"(Set -> Load)")
1059
                            if(changed && wp_tmp) HoTT_printfxy(0,7,"(Set -> Load)")
1042
                            else
1060
                            else
1043
                                {
1061
                                {
1044
                                 Hott_ClearLine(7);
1062
                                 Hott_ClearLine(7);
1045
                                 if(NaviData_WaypointNumber) HoTT_printfxy(0,7,"%s",WPL_Name);
1063
                                 if(NaviData_WaypointNumber) HoTT_printfxy(0,7,"%s",WPL_Name);
1046
                                }
1064
                                }
1047
                         }
1065
                         }
1048
                        if(HottKeyboard == HOTT_KEY_UP && wp_tmp < NaviData_MaxWpListIndex) { changed = 1; wp_tmp++; HoTTBlink = 0;}
1066
                        if(HottKeyboard == HOTT_KEY_UP && wp_tmp < NaviData_MaxWpListIndex) { changed = 1; wp_tmp++; HoTTBlink = 0;}
1049
                        if(HottKeyboard == HOTT_KEY_DOWN && wp_tmp > 1) { changed = 1; wp_tmp--; HoTTBlink = 0;};
1067
                        if(HottKeyboard == HOTT_KEY_DOWN && wp_tmp > 1) { changed = 1; wp_tmp--; HoTTBlink = 0;};
1050
                        if(HottKeyboard == HOTT_KEY_SET) { if(wp_tmp) ToNC_Load_SingePoint = wp_tmp; changed = 0;}
1068
                        if(HottKeyboard == HOTT_KEY_SET) { if(wp_tmp) ToNC_Load_SingePoint = wp_tmp; changed = 0;}
1051
//                      if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;}
1069
//                      if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;}
1052
                        if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;};
1070
                        if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;};
1053
                        HottKeyboard = 0;
1071
                        HottKeyboard = 0;
1054
                        break;
1072
                        break;
1055
   default:  line = 0;
1073
   default:  line = 0;
1056
                        break;
1074
                        break;
1057
  }
1075
  }
1058
  break;
1076
  break;
1059
  default:  page = 0;
1077
  default:  page = 0;
1060
  break;
1078
  break;
1061
 }
1079
 }
1062
}
1080
}
1063
 
1081
 
1064
#endif
1082
#endif
1065
 
1083
 
1066
 
1084
 
1067
       
1085
       
1068
 
1086