Subversion Repositories FlightCtrl

Rev

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

Rev 2608 Rev 2613
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, Show_Load_Time = 0, Show_Load_Value = 0, Show_Store_Time = 0, Show_Store_Value = 0;
61
unsigned char ToNC_Load_SingePoint = 0, ToNC_Store_SingePoint = 0, Show_Load_Time = 0, Show_Load_Value = 0, Show_Store_Time = 0, Show_Store_Value = 0;
62
char WPL_Name[10];// = {"         \0"};
62
char WPL_Name[10];// = {"         \0"};
63
 
63
 
64
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))
64
#if (defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__))
65
 
65
 
66
#define HoTT_printf(format, args...)                    {  _printf_P(&LIBFC_HoTT_Putchar, PSTR(format) , ## args);}
66
#define HoTT_printf(format, args...)                    {  _printf_P(&LIBFC_HoTT_Putchar, PSTR(format) , ## args);}
67
#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(x,y,format, args...)              { LIBFC_HoTT_SetPos((y) * 21 + (x)); _printf_P(&LIBFC_HoTT_Putchar, PSTR(format) , ## args);}
68
#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_INV(x,y,format, args...)          { LIBFC_HoTT_SetPos((y) * 21 + (x)); _printf_P(&LIBFC_HoTT_Putchar_INV, PSTR(format) , ## args);}
69
#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_printfxy_BLINK(x,y,format, args...)        { LIBFC_HoTT_SetPos((y) * 21 + (x)); _printf_P(&LIBFC_HoTT_Putchar_BLINK, PSTR(format) , ## args);}
70
#define HoTT_printf_BLINK(format, args...)              { _printf_P(&LIBFC_HoTT_Putchar_BLINK, PSTR(format) , ## args);}
70
#define HoTT_printf_BLINK(format, args...)              { _printf_P(&LIBFC_HoTT_Putchar_BLINK, PSTR(format) , ## args);}
71
#define HoTT_printf_INV(format, args...)                        { _printf_P(&LIBFC_HoTT_Putchar_INV, PSTR(format) , ## args);}
71
#define HoTT_printf_INV(format, args...)                        { _printf_P(&LIBFC_HoTT_Putchar_INV, PSTR(format) , ## args);}
72
 
72
 
73
#define VOICE_MINIMALE_EINGANSSPANNUNG    16
73
#define VOICE_MINIMALE_EINGANSSPANNUNG    16
74
#define VOICE_BEEP                         5
74
#define VOICE_BEEP                         5
75
#define HoTT_GRAD       96
75
#define HoTT_GRAD       96
76
#define HoTT_LINKS      123
76
#define HoTT_LINKS      123
77
#define HoTT_RECHTS 124
77
#define HoTT_RECHTS 124
78
#define HoTT_OBEN       125
78
#define HoTT_OBEN       125
79
#define HoTT_UNTEN      126
79
#define HoTT_UNTEN      126
80
 
80
 
81
#define HOTT_KEY_RIGHT  1
81
#define HOTT_KEY_RIGHT  1
82
#define HOTT_KEY_DOWN   2
82
#define HOTT_KEY_DOWN   2
83
#define HOTT_KEY_UP     4
83
#define HOTT_KEY_UP     4
84
#define HOTT_KEY_SET    6
84
#define HOTT_KEY_SET    6
85
#define HOTT_KEY_LEFT   8
85
#define HOTT_KEY_LEFT   8
86
 
86
 
87
#define VARIO_ZERO 30000
87
#define VARIO_ZERO 30000
88
unsigned int NaviData_TargetDistance = 0;
88
unsigned int NaviData_TargetDistance = 0;
89
 
89
 
90
unsigned char MaxBlTemperture = 0;
90
unsigned char MaxBlTemperture = 0;
91
unsigned char MinBlTemperture = 0;
91
unsigned char MinBlTemperture = 0;
92
unsigned char HottestBl = 0;
92
unsigned char HottestBl = 0;
93
 
93
 
94
GPSPacket_t GPSPacket;
94
GPSPacket_t GPSPacket;
95
VarioPacket_t VarioPacket;
95
VarioPacket_t VarioPacket;
96
ASCIIPacket_t ASCIIPacket;
96
ASCIIPacket_t ASCIIPacket;
97
ElectricAirPacket_t ElectricAirPacket;
97
ElectricAirPacket_t ElectricAirPacket;
98
HoTTGeneral_t HoTTGeneral;
98
HoTTGeneral_t HoTTGeneral;
99
unsigned char SpeakHoTT = SPEAK_MIKROKOPTER;
99
unsigned char SpeakHoTT = SPEAK_MIKROKOPTER;
100
unsigned char ToNC_SpeakHoTT = 0, ShowSettingNameTime = 0, ShowCmpsCalibrateTime = 0;
100
unsigned char ToNC_SpeakHoTT = 0, ShowSettingNameTime = 0, ShowCmpsCalibrateTime = 0;
101
int HoTTVarioMeter = 0;
101
int HoTTVarioMeter = 0;
102
const char PROGMEM MIKROKOPTER[] =      {"     MikroKopter     "};
102
const char PROGMEM MIKROKOPTER[] =      {"     MikroKopter     "};
103
const char PROGMEM UNDERVOLTAGE[] =     {" !! LiPo voltage !!  "};
103
const char PROGMEM UNDERVOLTAGE[] =     {" !! LiPo voltage !!  "};
104
const char PROGMEM LANDING[] =      {" !!   LANDING    !!  "};
104
const char PROGMEM LANDING[] =      {" !!   LANDING    !!  "};
105
const char PROGMEM SIMULATION[] =       {"  SIMULATION active  "};
105
const char PROGMEM SIMULATION[] =       {"  SIMULATION active  "};
106
const char PROGMEM BOAT_MODE[] =        {" MikroKopter (Boat)  "};
106
const char PROGMEM BOAT_MODE[] =        {" MikroKopter (Boat)  "};
107
const char PROGMEM STORE[] =            {" Store Position SP1  "};
107
const char PROGMEM STORE[] =            {" Store Position SP1  "};
108
const char PROGMEM LOAD[] =             {" Load Position SP1   "};
108
const char PROGMEM LOAD[] =             {" Load Position SP1   "};
109
const char PROGMEM SETTING[] =  {"Set  :"};
109
const char PROGMEM SETTING[] =  {"Set  :"};
110
 
110
 
111
const char PROGMEM CALIBRATE_TEXT[6][21] =
111
const char PROGMEM CALIBRATE_TEXT[6][21] =
112
{
112
{
113
//0123456789123456
113
//0123456789123456
114
 "Finished            \0",  // 0
114
 "Finished            \0",  // 0
115
 "Compass Calibration \0",  // 1
115
 "Compass Calibration \0",  // 1
116
 "1:Rotate Nick & Roll\0",  // 2
116
 "1:Rotate Nick & Roll\0",  // 2
117
 "2: idle             \0",  // 3
117
 "2: idle             \0",  // 3
118
 "3:Rotate Nick & Roll\0",  // 4
118
 "3:Rotate Nick & Roll\0",  // 4
119
 "4:Stored            \0",  // 5
119
 "4:Stored            \0",  // 5
120
};
120
};
121
 
121
 
122
const char PROGMEM NC_ERROR_TEXT[MAX_ERR_NUMBER][17] =
122
const char PROGMEM NC_ERROR_TEXT[MAX_ERR_NUMBER][17] =
123
{
123
{
124
//0123456789123456
124
//0123456789123456
125
 "No Error        \0",  // 0
125
 "No Error        \0",  // 0
126
 "Not compatible  \0",  // 1
126
 "Not compatible  \0",  // 1
127
 "MK3Mag not compa\0",  // 2
127
 "MK3Mag not compa\0",  // 2
128
 "No FC communicat\0",  // 3
128
 "No FC communicat\0",  // 3
129
 "Compass communic\0",  // 4
129
 "Compass communic\0",  // 4
130
 "GPS communicatio\0",  // 5
130
 "GPS communicatio\0",  // 5
131
 "compass value   \0",  // 6
131
 "compass value   \0",  // 6
132
 "RC Signal lost  \0",  // 7
132
 "RC Signal lost  \0",  // 7
133
 "FC spi rx error \0",  // 8
133
 "FC spi rx error \0",  // 8
134
 "No NC communicat\0",  // 9
134
 "No NC communicat\0",  // 9
135
 "FC Nick Gyro    \0",  // 10
135
 "FC Nick Gyro    \0",  // 10
136
 "FC Roll Gyro    \0",  // 11
136
 "FC Roll Gyro    \0",  // 11
137
 "FC Yaw Gyro     \0",  // 12
137
 "FC Yaw Gyro     \0",  // 12
138
 "FC Nick ACC     \0",  // 13
138
 "FC Nick ACC     \0",  // 13
139
 "FC Roll ACC     \0",  // 14
139
 "FC Roll ACC     \0",  // 14
140
 "FC Z-ACC        \0",  // 15
140
 "FC Z-ACC        \0",  // 15
141
 "Pressure sensor \0",  // 16
141
 "Pressure sensor \0",  // 16
142
 "I2C FC->BL-Ctrl \0",  // 17
142
 "I2C FC->BL-Ctrl \0",  // 17
143
 "Bl Missing      \0",  // 18
143
 "Bl Missing      \0",  // 18
144
 "Mixer Error     \0",  // 19
144
 "Mixer Error     \0",  // 19
145
 "Carefree Error  \0",  // 20
145
 "Carefree Error  \0",  // 20
146
 "GPS Fix lost    \0",  // 21
146
 "GPS Fix lost    \0",  // 21
147
 "Magnet Error    \0",  // 22
147
 "Magnet Error    \0",  // 22
148
 "Motor restart   \0",  // 23
148
 "Motor restart   \0",  // 23
149
 "BL Limitation   \0",  // 24
149
 "BL Limitation   \0",  // 24
150
 "GPS Range       \0",  // 25
150
 "GPS Range       \0",  // 25
151
 "No SD-Card      \0",  // 26
151
 "No SD-Card      \0",  // 26
152
 "SD-Logging error\0",  // 27
152
 "SD-Logging error\0",  // 27
153
 "Flying range!   \0",  // 28
153
 "Flying range!   \0",  // 28
154
 "Max Altitude!   \0",  // 29
154
 "Max Altitude!   \0",  // 29
155
 "No GPS fix      \0",  // 30
155
 "No GPS fix      \0",  // 30
156
 "compass not cal.\0",  // 31
156
 "compass not cal.\0",  // 31
157
 "BL-Selftest     \0",  // 32
157
 "BL-Selftest     \0",  // 32
158
 "no ext. compass \0",  // 33
158
 "no ext. compass \0",  // 33
159
 "compass sensor  \0",  // 34
159
 "compass sensor  \0",  // 34
160
 "Failsafe postion\0",  // 35
160
 "Failsafe postion\0",  // 35
161
 "No Redundancy!  \0",  // 36
161
 "No Redundancy!  \0",  // 36
162
 "Redundancy test \0",  // 37
162
 "Redundancy test \0",  // 37
163
 "GPS Update Rate \0",  // 38
163
 "GPS Update Rate \0",  // 38
164
 "Canbus Error    \0",  // 39
164
 "Canbus Error    \0",  // 39
165
 "5V RC-Supply    \0",  // 40
165
 "5V RC-Supply    \0",  // 40
166
 "Power-Supply    \0",  // 41
166
 "Power-Supply    \0",  // 41
167
 "ACC not calibr. \0",  // 42
167
 "ACC not calibr. \0",  // 42
168
 };
168
 };
169
 
169
 
170
 
170
 
171
const char PROGMEM HOTT_ERROR[MAX_ERR_NUMBER][2] =
171
const char PROGMEM HOTT_ERROR[MAX_ERR_NUMBER][2] =
172
{       // 1 -> only in flight   0 -> also on ground
172
{       // 1 -> only in flight   0 -> also on ground
173
//0123456789123456
173
//0123456789123456
174
         {0,0},// "No Error        \0",  // 0
174
         {0,0},// "No Error        \0",  // 0
175
         {SPEAK_ERROR,0},               // "Not compatible  \0",        // 1
175
         {SPEAK_ERROR,0},               // "Not compatible  \0",        // 1
176
         {SPEAK_ERROR,0},               // "MK3Mag not compa\0",        // 2
176
         {SPEAK_ERROR,0},               // "MK3Mag not compa\0",        // 2
177
         {SPEAK_ERR_NAVI,1},    // "No FC communicat\0",        // 3
177
         {SPEAK_ERR_NAVI,1},    // "No FC communicat\0",        // 3
178
         {SPEAK_ERR_COMPASS,1}, // "MK3Mag communica\0",        // 4
178
         {SPEAK_ERR_COMPASS,1}, // "MK3Mag communica\0",        // 4
179
         {SPEAK_ERR_GPS,0},             // "GPS communicatio\0",        // 5
179
         {SPEAK_ERR_GPS,0},             // "GPS communicatio\0",        // 5
180
         {SPEAK_ERR_COMPASS,1}, // "compass value   \0",        // 6
180
         {SPEAK_ERR_COMPASS,1}, // "compass value   \0",        // 6
181
         {SPEAK_ERR_RECEICER,0},// "RC Signal lost  \0",        // 7
181
         {SPEAK_ERR_RECEICER,0},// "RC Signal lost  \0",        // 7
182
         {SPEAK_ERR_NAVI,0},    // "FC spi rx error \0",        // 8
182
         {SPEAK_ERR_NAVI,0},    // "FC spi rx error \0",        // 8
183
         {SPEAK_ERR_NAVI,0},    // "No NC communicat\0",        // 9
183
         {SPEAK_ERR_NAVI,0},    // "No NC communicat\0",        // 9
184
         {SPEAK_ERR_SENSOR,0},  // "FC Nick Gyro    \0",        // 10
184
         {SPEAK_ERR_SENSOR,0},  // "FC Nick Gyro    \0",        // 10
185
         {SPEAK_ERR_SENSOR,0},  // "FC Roll Gyro    \0",        // 11
185
         {SPEAK_ERR_SENSOR,0},  // "FC Roll Gyro    \0",        // 11
186
         {SPEAK_ERR_SENSOR,0},  // "FC Yaw Gyro     \0",        // 12
186
         {SPEAK_ERR_SENSOR,0},  // "FC Yaw Gyro     \0",        // 12
187
         {SPEAK_ERR_SENSOR,0},  // "FC Nick ACC     \0",        // 13
187
         {SPEAK_ERR_SENSOR,0},  // "FC Nick ACC     \0",        // 13
188
         {SPEAK_ERR_SENSOR,0},  // "FC Roll ACC     \0",        // 14
188
         {SPEAK_ERR_SENSOR,0},  // "FC Roll ACC     \0",        // 14
189
         {SPEAK_ERR_SENSOR,0},  // "FC Z-ACC        \0",        // 15
189
         {SPEAK_ERR_SENSOR,0},  // "FC Z-ACC        \0",        // 15
190
         {SPEAK_ERR_SENSOR,0},  // "Pressure sensor \0",        // 16
190
         {SPEAK_ERR_SENSOR,0},  // "Pressure sensor \0",        // 16
191
         {SPEAK_ERR_DATABUS,1}, // "I2C FC->BL-Ctrl \0",        // 17
191
         {SPEAK_ERR_DATABUS,1}, // "I2C FC->BL-Ctrl \0",        // 17
192
         {SPEAK_ERR_DATABUS,1}, // "Bl Missing      \0",        // 18
192
         {SPEAK_ERR_DATABUS,1}, // "Bl Missing      \0",        // 18
193
         {SPEAK_ERROR,0},               // "Mixer Error     \0",        // 19
193
         {SPEAK_ERROR,0},               // "Mixer Error     \0",        // 19
194
         {SPEAK_CF_OFF,1},              // "Carefree Error  \0",        // 20
194
         {SPEAK_CF_OFF,1},              // "Carefree Error  \0",        // 20
195
         {SPEAK_GPS_FIX,1},             // "GPS Fix lost    \0",        // 21
195
         {SPEAK_GPS_FIX,1},             // "GPS Fix lost    \0",        // 21
196
         {SPEAK_ERR_COMPASS,0}, // "Magnet Error    \0",        // 22
196
         {SPEAK_ERR_COMPASS,0}, // "Magnet Error    \0",        // 22
197
         {SPEAK_ERR_MOTOR,1},   // "Motor restart   \0",        // 23
197
         {SPEAK_ERR_MOTOR,1},   // "Motor restart   \0",        // 23
198
         {SPEAK_MAX_TEMPERAT,1},// "BL Limitation   \0",        // 24
198
         {SPEAK_MAX_TEMPERAT,1},// "BL Limitation   \0",        // 24
199
         {SPEAK_MAX_RANGE,1},   // "GPS Range       \0",        // 25
199
         {SPEAK_MAX_RANGE,1},   // "GPS Range       \0",        // 25
200
         {SPEAK_ERROR,1},               // "No SD-Card      \0",        // 26
200
         {SPEAK_ERROR,1},               // "No SD-Card      \0",        // 26
201
         {SPEAK_ERROR,1},               // "SD-Logging error\0",        // 27
201
         {SPEAK_ERROR,1},               // "SD-Logging error\0",        // 27
202
         {SPEAK_MAX_RANGE,1},   // "Flying range!   \0",        // 28
202
         {SPEAK_MAX_RANGE,1},   // "Flying range!   \0",        // 28
203
         {SPEAK_MAX_ALTITUD,1}, // "Max Altitude!   \0"         // 29
203
         {SPEAK_MAX_ALTITUD,1}, // "Max Altitude!   \0"         // 29
204
         {SPEAK_GPS_FIX,1},             // "No GPS fix      \0"         // 30
204
         {SPEAK_GPS_FIX,1},             // "No GPS fix      \0"         // 30
205
         {SPEAK_ERR_CALIBARTION,0},// "compass not cal."        // 31
205
         {SPEAK_ERR_CALIBARTION,0},// "compass not cal."        // 31
206
         {SPEAK_ERR_MOTOR,0},   // "BL-Selftest     \0"         // 32
206
         {SPEAK_ERR_MOTOR,0},   // "BL-Selftest     \0"         // 32
207
         {SPEAK_ERR_COMPASS,0}, // "no ext. compass"            // 33
207
         {SPEAK_ERR_COMPASS,0}, // "no ext. compass"            // 33
208
         {SPEAK_ERR_COMPASS,0}, // "compass sensor"             // 34
208
         {SPEAK_ERR_COMPASS,0}, // "compass sensor"             // 34
209
         {SPEAK_ERROR,1},               // "Failsafe postion0",         // 35
209
         {SPEAK_ERROR,1},               // "Failsafe postion0",         // 35
210
         {SPEAK_ERROR,0},               // "No Redundancy!",            // 36
210
         {SPEAK_ERROR,0},               // "No Redundancy!",            // 36
211
         {0,0},                                 // "Redundancy test",           // 37
211
         {0,0},                                 // "Redundancy test",           // 37
212
         {SPEAK_ERR_GPS,0},             // "GPS Update Rate",           // 38
212
         {SPEAK_ERR_GPS,0},             // "GPS Update Rate",           // 38
213
         {SPEAK_ERR_DATABUS,0}, // "Canbus Error!                       // 39    
213
         {SPEAK_ERR_DATABUS,0}, // "Canbus Error!                       // 39    
214
         {SPEAK_ERROR,0},               // "5V Supply"                          // 40    
214
         {SPEAK_ERROR,0},               // "5V Supply"                          // 40    
215
         {SPEAK_UNDERVOLTAGE,0},// "Power Supply"                       // 41    
215
         {SPEAK_UNDERVOLTAGE,0},// "Power Supply"                       // 41    
216
         {SPEAK_ERR_SENSOR,0},  // "ACC not calibr. ",          // 42
216
         {SPEAK_ERR_SENSOR,0},  // "ACC not calibr. ",          // 42
217
};
217
};
218
 
218
 
219
/*
219
/*
220
//------------------------------------------------------------------------------------------
220
//------------------------------------------------------------------------------------------
221
// HoTT-Plus
221
// HoTT-Plus
222
//------------------------------------------------------------------------------------------
222
//------------------------------------------------------------------------------------------
223
char dummy=0;
223
char dummy=0;
224
const Parameter_List_t Parameter_List[] =
224
const Parameter_List_t Parameter_List[] =
225
{ //offset,min,max,name,variable
225
{ //offset,min,max,name,variable
226
        {127, 0, 247,"SP1", (unsigned char *) &PPM_in[13] },
226
        {127, 0, 247,"SP1", (unsigned char *) &PPM_in[13] },
227
        {127, 0, 247,"SP2", (unsigned char *) &PPM_in[14] },   
227
        {127, 0, 247,"SP2", (unsigned char *) &PPM_in[14] },   
228
        {127, 0, 247,"SP3", (unsigned char *) &PPM_in[15] },   
228
        {127, 0, 247,"SP3", (unsigned char *) &PPM_in[15] },   
229
        {127, 0, 247,"SP4", (unsigned char *) &PPM_in[16] },   
229
        {127, 0, 247,"SP4", (unsigned char *) &PPM_in[16] },   
230
        {  0, 0, 247,"HD ", (unsigned char *) &EE_Parameter.Luftdruck_D },
230
        {  0, 0, 247,"HD ", (unsigned char *) &EE_Parameter.Luftdruck_D },
231
        {  0, 0, 247,"HP ", (unsigned char *) &EE_Parameter.Hoehe_P },
231
        {  0, 0, 247,"HP ", (unsigned char *) &EE_Parameter.Hoehe_P },
232
        {  0, 0, 247,"HA ", (unsigned char *) &EE_Parameter.Hoehe_ACC_Wirkung },
232
        {  0, 0, 247,"HA ", (unsigned char *) &EE_Parameter.Hoehe_ACC_Wirkung },
233
        {  0, 0, 247,"HM ", (unsigned char *) &EE_Parameter.Hoehe_MinGas },
233
        {  0, 0, 247,"HM ", (unsigned char *) &EE_Parameter.Hoehe_MinGas },
234
        {  0, 0, 247,"HV ", (unsigned char *) &EE_Parameter.Hoehe_HoverBand },
234
        {  0, 0, 247,"HV ", (unsigned char *) &EE_Parameter.Hoehe_HoverBand },
235
        {  0, 0, 247,"HG ", (unsigned char *) &EE_Parameter.Hoehe_Verstaerkung },
235
        {  0, 0, 247,"HG ", (unsigned char *) &EE_Parameter.Hoehe_Verstaerkung },
236
        {  0, 0, 247,"NG ", (unsigned char *) &EE_Parameter.NotGas },
236
        {  0, 0, 247,"NG ", (unsigned char *) &EE_Parameter.NotGas },
237
        {  0, 0, 247,"StP", (unsigned char *) &EE_Parameter.Stick_P },
237
        {  0, 0, 247,"StP", (unsigned char *) &EE_Parameter.Stick_P },
238
        {  0, 0, 247,"StD", (unsigned char *) &EE_Parameter.Stick_D },
238
        {  0, 0, 247,"StD", (unsigned char *) &EE_Parameter.Stick_D },
239
        {  0, 0, 247,"SGP", (unsigned char *) &EE_Parameter.StickGier_P },
239
        {  0, 0, 247,"SGP", (unsigned char *) &EE_Parameter.StickGier_P },
240
        {  0, 0, 247,"DrC", (unsigned char *) &EE_Parameter.Driftkomp },
240
        {  0, 0, 247,"DrC", (unsigned char *) &EE_Parameter.Driftkomp },
241
        {  0, 0, 247,"GYP", (unsigned char *) &EE_Parameter.Gyro_P },
241
        {  0, 0, 247,"GYP", (unsigned char *) &EE_Parameter.Gyro_P },
242
        {  0, 0, 247,"GYD", (unsigned char *) &EE_Parameter.Gyro_D },
242
        {  0, 0, 247,"GYD", (unsigned char *) &EE_Parameter.Gyro_D },
243
        {  0, 0, 247,"GYI", (unsigned char *) &EE_Parameter.Gyro_I },
243
        {  0, 0, 247,"GYI", (unsigned char *) &EE_Parameter.Gyro_I },
244
        {  0, 0, 247,"MaI", (unsigned char *) &EE_Parameter.I_Faktor },
244
        {  0, 0, 247,"MaI", (unsigned char *) &EE_Parameter.I_Faktor },
245
        {  0, 0, 247,"GGP", (unsigned char *) &EE_Parameter.Gyro_Gier_P },
245
        {  0, 0, 247,"GGP", (unsigned char *) &EE_Parameter.Gyro_Gier_P },
246
        {  0, 0, 247,"GGI", (unsigned char *) &EE_Parameter.Gyro_Gier_I },
246
        {  0, 0, 247,"GGI", (unsigned char *) &EE_Parameter.Gyro_Gier_I },
247
        {  0, 0,  15,"GSt", (unsigned char *) &EE_Parameter.Gyro_Stability },
247
        {  0, 0,  15,"GSt", (unsigned char *) &EE_Parameter.Gyro_Stability },
248
        {  0, 0, 247,"DSt", (unsigned char *) &EE_Parameter.DynamicStability },
248
        {  0, 0, 247,"DSt", (unsigned char *) &EE_Parameter.DynamicStability },
249
        {  0, 0, 247,"NGG", (unsigned char *) &EE_Parameter.NaviGpsGain },
249
        {  0, 0, 247,"NGG", (unsigned char *) &EE_Parameter.NaviGpsGain },
250
        {  0, 0, 247,"NWC", (unsigned char *) &EE_Parameter.NaviWindCorrection },
250
        {  0, 0, 247,"NWC", (unsigned char *) &EE_Parameter.NaviWindCorrection },
251
        {  0, 0, 247,"NSC", (unsigned char *) &EE_Parameter.NaviAccCompensation },
251
        {  0, 0, 247,"NSC", (unsigned char *) &EE_Parameter.NaviAccCompensation },
252
        {  0, 0, 247,"NAL", (unsigned char *) &EE_Parameter.NaviAngleLimitation },
252
        {  0, 0, 247,"NAL", (unsigned char *) &EE_Parameter.NaviAngleLimitation },
253
        {  0, 0, 247,"NP ", (unsigned char *) &EE_Parameter.NaviGpsP },
253
        {  0, 0, 247,"NP ", (unsigned char *) &EE_Parameter.NaviGpsP },
254
        {  0, 0, 247,"ND ", (unsigned char *) &EE_Parameter.NaviGpsI },
254
        {  0, 0, 247,"ND ", (unsigned char *) &EE_Parameter.NaviGpsI },
255
        {  0, 0, 247,"NI ", (unsigned char *) &EE_Parameter.NaviGpsD },
255
        {  0, 0, 247,"NI ", (unsigned char *) &EE_Parameter.NaviGpsD },
256
        {  0, 0, 247,"LGL", (unsigned char *) &EE_Parameter.LoopGasLimit },
256
        {  0, 0, 247,"LGL", (unsigned char *) &EE_Parameter.LoopGasLimit },
257
        {  0, 0, 247,"LHy", (unsigned char *) &EE_Parameter.LoopHysterese },
257
        {  0, 0, 247,"LHy", (unsigned char *) &EE_Parameter.LoopHysterese },
258
        {  0, 0, 247,"LTh", (unsigned char *) &EE_Parameter.LoopThreshold },
258
        {  0, 0, 247,"LTh", (unsigned char *) &EE_Parameter.LoopThreshold },
259
        {  0, 0,   0,"   ", (unsigned char *) &dummy },
259
        {  0, 0,   0,"   ", (unsigned char *) &dummy },
260
        {  0, 0, 247,"FGP", (unsigned char *) &EE_Parameter.AchsKopplung1},
260
        {  0, 0, 247,"FGP", (unsigned char *) &EE_Parameter.AchsKopplung1},
261
        {  0, 0, 247,"FNR", (unsigned char *) &EE_Parameter.AchsKopplung2},
261
        {  0, 0, 247,"FNR", (unsigned char *) &EE_Parameter.AchsKopplung2},
262
        {  0, 0, 247,"CYC", (unsigned char *) &EE_Parameter.CouplingYawCorrection},
262
        {  0, 0, 247,"CYC", (unsigned char *) &EE_Parameter.CouplingYawCorrection},
263
        {  0, 0, 247,"MSH", (unsigned char *) &EE_Parameter.MotorSmooth},
263
        {  0, 0, 247,"MSH", (unsigned char *) &EE_Parameter.MotorSmooth},
264
        {  0, 0, 247,"NCT", (unsigned char *) &EE_Parameter.ServoNickControl },
264
        {  0, 0, 247,"NCT", (unsigned char *) &EE_Parameter.ServoNickControl },
265
        {  0, 0, 247,"NCP", (unsigned char *) &EE_Parameter.ServoNickComp },
265
        {  0, 0, 247,"NCP", (unsigned char *) &EE_Parameter.ServoNickComp },
266
        {  0, 0, 247,"RCT", (unsigned char *) &EE_Parameter.ServoRollControl },
266
        {  0, 0, 247,"RCT", (unsigned char *) &EE_Parameter.ServoRollControl },
267
        {  0, 0, 247,"RCP", (unsigned char *) &EE_Parameter.ServoRollComp }
267
        {  0, 0, 247,"RCP", (unsigned char *) &EE_Parameter.ServoRollComp }
268
};
268
};
269
unsigned char settingdest = 0;
269
unsigned char settingdest = 0;
270
//------------------------------------------------------------------------------------------
270
//------------------------------------------------------------------------------------------
271
// HoTT-Plus
271
// HoTT-Plus
272
//------------------------------------------------------------------------------------------
272
//------------------------------------------------------------------------------------------
273
*/
273
*/
274
void GetHottestBl(void)
274
void GetHottestBl(void)
275
{
275
{
276
 static unsigned char search = 0,tmp_max,tmp_min,who;
276
 static unsigned char search = 0,tmp_max,tmp_min,who;
277
                if(Motor[search].Temperature > tmp_max) { tmp_max = Motor[search].Temperature; who = search;}
277
                if(Motor[search].Temperature > tmp_max) { tmp_max = Motor[search].Temperature; who = search;}
278
                else
278
                else
279
                if(Motor[search].Temperature) if(Motor[search].Temperature < tmp_min) tmp_min = Motor[search].Temperature;
279
                if(Motor[search].Temperature) if(Motor[search].Temperature < tmp_min) tmp_min = Motor[search].Temperature;
280
                if(++search >= MAX_MOTORS)
280
                if(++search >= MAX_MOTORS)
281
                {
281
                {
282
                 search = 0;
282
                 search = 0;
283
                 if(tmp_min != 255) MinBlTemperture = tmp_min; else MinBlTemperture = 0;
283
                 if(tmp_min != 255) MinBlTemperture = tmp_min; else MinBlTemperture = 0;
284
                 MaxBlTemperture = tmp_max;
284
                 MaxBlTemperture = tmp_max;
285
                 HottestBl = who;
285
                 HottestBl = who;
286
                 tmp_min = 255;
286
                 tmp_min = 255;
287
                 tmp_max = 0;
287
                 tmp_max = 0;
288
                 who = 0;
288
                 who = 0;
289
                 }
289
                 }
290
}
290
}
291
 
291
 
292
//---------------------------------------------------------------
292
//---------------------------------------------------------------
293
void Hott_ClearLine(unsigned char line)
293
void Hott_ClearLine(unsigned char line)
294
{
294
{
295
 HoTT_printfxy(0,line,"                     ");
295
 HoTT_printfxy(0,line,"                     ");
296
}
296
}
297
//---------------------------------------------------------------
297
//---------------------------------------------------------------
298
 
298
 
299
 
299
 
300
unsigned char HoTT_Waring(void)
300
unsigned char HoTT_Waring(void)
301
{
301
{
302
  unsigned char status = 0;
302
  unsigned char status = 0;
303
  static char old_status = 0;
303
  static char old_status = 0;
304
  static int repeat;
304
  static int repeat;
305
//if(Parameter_UserParam1) SpeakHoTT = Parameter_UserParam1;
305
//if(Parameter_UserParam1) SpeakHoTT = Parameter_UserParam1;
306
  ToNC_SpeakHoTT = SpeakHoTT;
306
  ToNC_SpeakHoTT = SpeakHoTT;
307
  if(FC_StatusFlags & FC_STATUS_LOWBAT)
307
  if(FC_StatusFlags & FC_STATUS_LOWBAT)
308
   {
308
   {
309
    if(LowVoltageLandingActive && (EE_Parameter.Receiver == RECEIVER_HOTT)) status = SPEAK_LANDING;
309
    if(LowVoltageLandingActive && (EE_Parameter.Receiver == RECEIVER_HOTT)) status = SPEAK_LANDING;
310
        else status = VOICE_MINIMALE_EINGANSSPANNUNG; // Jeti hat kein wort: "LANDEN"
310
        else status = VOICE_MINIMALE_EINGANSSPANNUNG; // Jeti hat kein wort: "LANDEN"
311
        if(SpeakHoTT && old_status == VOICE_MINIMALE_EINGANSSPANNUNG) status = SpeakHoTT; // das soll auch noch durch kommen
311
        if(SpeakHoTT && old_status == VOICE_MINIMALE_EINGANSSPANNUNG) status = SpeakHoTT; // das soll auch noch durch kommen
312
   }   
312
   }   
313
  else
313
  else
314
  if(NC_ErrorCode && NC_ErrorCode < MAX_ERR_NUMBER)     // Fehlercodes
314
  if(NC_ErrorCode && NC_ErrorCode < MAX_ERR_NUMBER)     // Fehlercodes
315
   {
315
   {
316
    if(MotorenEin || !pgm_read_byte(&HOTT_ERROR[NC_ErrorCode][1])) status = pgm_read_byte(&HOTT_ERROR[NC_ErrorCode][0]);
316
    if(MotorenEin || !pgm_read_byte(&HOTT_ERROR[NC_ErrorCode][1])) status = pgm_read_byte(&HOTT_ERROR[NC_ErrorCode][0]);
317
   }
317
   }
318
  if(!status)    // Sprachansagen
318
  if(!status)    // Sprachansagen
319
   {
319
   {
320
//      if(!(GetParamByte(PID_SPEAK_HOTT_CFG) & 0x01)) SpeakHoTT = 0;  // is the voice wanted?
320
//      if(!(GetParamByte(PID_SPEAK_HOTT_CFG) & 0x01)) SpeakHoTT = 0;  // is the voice wanted?
321
    if(!(EE_Parameter.GlobalConfig3 & CFG3_SPEAK_ALL)) SpeakHoTT = 0;  // is the voice wanted?
321
    if(!(EE_Parameter.GlobalConfig3 & CFG3_SPEAK_ALL)) SpeakHoTT = 0;  // is the voice wanted?
322
    else status = SpeakHoTT;
322
    else status = SpeakHoTT;
323
   }
323
   }
324
   else ToNC_SpeakHoTT = status;
324
   else ToNC_SpeakHoTT = status;
325
 
325
 
326
  if(old_status == status) // Gleichen Fehler nur alle 4 sek bringen
326
  if(old_status == status) // Gleichen Fehler nur alle 4 sek bringen
327
   {
327
   {
328
    if(!CheckDelay(repeat)) return(0);
328
    if(!CheckDelay(repeat)) return(0);
329
        repeat = SetDelay(4000);
329
        repeat = SetDelay(4000);
330
   }
330
   }
331
   else repeat = SetDelay(2000);
331
   else repeat = SetDelay(2000);
332
 
332
 
333
  if(status)
333
  if(status)
334
   {
334
   {
335
    if(status == SpeakHoTT) SpeakHoTT = 0;
335
    if(status == SpeakHoTT) SpeakHoTT = 0;
336
   }   
336
   }   
337
  old_status = status;
337
  old_status = status;
338
  return(status);
338
  return(status);
339
}
339
}
340
 
340
 
341
//---------------------------------------------------------------
341
//---------------------------------------------------------------
342
void NC_Fills_HoTT_Telemety(void)
342
void NC_Fills_HoTT_Telemety(void)
343
{
343
{
344
 unsigned char *ptr = NULL;
344
 unsigned char *ptr = NULL;
345
 unsigned char max = 0,i,z;
345
 unsigned char max = 0,i,z;
346
 switch(FromNaviCtrl.Param.Byte[11])
346
 switch(FromNaviCtrl.Param.Byte[11])
347
  {
347
  {
348
   case HOTT_VARIO_PACKET_ID:
348
   case HOTT_VARIO_PACKET_ID:
349
                ptr = (unsigned char *) &VarioPacket;
349
                ptr = (unsigned char *) &VarioPacket;
350
                max = sizeof(VarioPacket);
350
                max = sizeof(VarioPacket);
351
                break;
351
                break;
352
   case HOTT_GPS_PACKET_ID:
352
   case HOTT_GPS_PACKET_ID:
353
                ptr = (unsigned char *) &GPSPacket;
353
                ptr = (unsigned char *) &GPSPacket;
354
                max = sizeof(GPSPacket);
354
                max = sizeof(GPSPacket);
355
                break;
355
                break;
356
   case HOTT_ELECTRIC_AIR_PACKET_ID:
356
   case HOTT_ELECTRIC_AIR_PACKET_ID:
357
                ptr = (unsigned char *) &ElectricAirPacket;
357
                ptr = (unsigned char *) &ElectricAirPacket;
358
                max = sizeof(ElectricAirPacket);
358
                max = sizeof(ElectricAirPacket);
359
                break;
359
                break;
360
   case HOTT_GENERAL_PACKET_ID:
360
   case HOTT_GENERAL_PACKET_ID:
361
                ptr = (unsigned char *) &HoTTGeneral;
361
                ptr = (unsigned char *) &HoTTGeneral;
362
                max = sizeof(HoTTGeneral);
362
                max = sizeof(HoTTGeneral);
363
                break;
363
                break;
364
   case JETI_GPS_PACKET_ID1:
364
   case JETI_GPS_PACKET_ID1:
365
                ptr = (unsigned char *) &JetiExData[14].Value;
365
                ptr = (unsigned char *) &JetiExData[14].Value;
366
                max = sizeof(JetiExData[14].Value);
366
                max = sizeof(JetiExData[14].Value);
367
                break;
367
                break;
368
   case JETI_GPS_PACKET_ID2:
368
   case JETI_GPS_PACKET_ID2:
369
                ptr = (unsigned char *) &JetiExData[15].Value;
369
                ptr = (unsigned char *) &JetiExData[15].Value;
370
                max = sizeof(JetiExData[15].Value);
370
                max = sizeof(JetiExData[15].Value);
371
                break;
371
                break;
372
   case HOTT_WPL_NAME:
372
   case HOTT_WPL_NAME:
373
                ptr = (unsigned char *) WPL_Name;
373
                ptr = (unsigned char *) WPL_Name;
374
                max = sizeof(WPL_Name)-1;
374
                max = sizeof(WPL_Name)-1;
375
                break;
375
                break;
376
 
376
 
377
  }
377
  }
378
 z = FromNaviCtrl.Param.Byte[0]; // Data allocation
378
 z = FromNaviCtrl.Param.Byte[0]; // Data allocation
379
 
379
 
380
 for(i=0; i < FromNaviCtrl.Param.Byte[1]; i++)
380
 for(i=0; i < FromNaviCtrl.Param.Byte[1]; i++)
381
  {
381
  {
382
   if(z >= max) break;
382
   if(z >= max) break;
383
   ptr[z] = FromNaviCtrl.Param.Byte[2+i];
383
   ptr[z] = FromNaviCtrl.Param.Byte[2+i];
384
   z++;
384
   z++;
385
  }
385
  }
386
}
386
}
387
 
387
 
388
unsigned int BuildHoTT_Vario(void)
388
unsigned int BuildHoTT_Vario(void)
389
{
389
{
390
 unsigned int tmp = VARIO_ZERO;
390
 unsigned int tmp = VARIO_ZERO;
391
 if(VarioCharacter == '+' || VarioCharacter == '-')
391
 if(VarioCharacter == '+' || VarioCharacter == '-')
392
  {
392
  {
393
   tmp = VARIO_ZERO + (AltitudeSetpointTrimming * EE_Parameter.Hoehe_Verstaerkung) / 3;
393
   tmp = VARIO_ZERO + (AltitudeSetpointTrimming * EE_Parameter.Hoehe_Verstaerkung) / 3;
394
   if(tmp < VARIO_ZERO && tmp > VARIO_ZERO - 50) tmp = VARIO_ZERO - 50; // weil es sonst erst bei < 0,5m/sek piept
394
   if(tmp < VARIO_ZERO && tmp > VARIO_ZERO - 50) tmp = VARIO_ZERO - 50; // weil es sonst erst bei < 0,5m/sek piept
395
  }
395
  }
396
 else
396
 else
397
 if((VarioCharacter == ' ') && (FC_StatusFlags & FC_STATUS_FLY))
397
 if((VarioCharacter == ' ') && (FC_StatusFlags & FC_STATUS_FLY))
398
  {
398
  {
399
   tmp = VARIO_ZERO + HoTTVarioMeter;
399
   tmp = VARIO_ZERO + HoTTVarioMeter;
400
   if(tmp > VARIO_ZERO)
400
   if(tmp > VARIO_ZERO)
401
    {
401
    {
402
     if(tmp < VARIO_ZERO + 100) tmp = VARIO_ZERO;
402
     if(tmp < VARIO_ZERO + 100) tmp = VARIO_ZERO;
403
         else tmp -= 100;
403
         else tmp -= 100;
404
        }
404
        }
405
   if(tmp < VARIO_ZERO)
405
   if(tmp < VARIO_ZERO)
406
    {
406
    {
407
     if(tmp > VARIO_ZERO - 100) tmp = VARIO_ZERO;
407
     if(tmp > VARIO_ZERO - 100) tmp = VARIO_ZERO;
408
         else tmp += 100;
408
         else tmp += 100;
409
        }
409
        }
410
  }
410
  }
411
 else
411
 else
412
 if(VarioCharacter == '^') tmp = VARIO_ZERO + FromNC_AltitudeSpeed * 10;
412
 if(VarioCharacter == '^') tmp = VARIO_ZERO + FromNC_AltitudeSpeed * 10;
413
 else
413
 else
414
 if(VarioCharacter == 'v') tmp = VARIO_ZERO - FromNC_AltitudeSpeed * 10;
414
 if(VarioCharacter == 'v') tmp = VARIO_ZERO - FromNC_AltitudeSpeed * 10;
415
 return(tmp);
415
 return(tmp);
416
}
416
}
417
 
417
 
418
//---------------------------------------------------------------
418
//---------------------------------------------------------------
419
unsigned char HoTT_Telemety(unsigned char packet_request)
419
unsigned char HoTT_Telemety(unsigned char packet_request)
420
{
420
{
421
 unsigned char i = 0;
421
 unsigned char i = 0;
422
 static unsigned char SpeechMessage = 0;
422
 static unsigned char SpeechMessage = 0;
423
  //Debug("rqst: %02X",packet_request);
423
  //Debug("rqst: %02X",packet_request);
424
 
424
 
425
 switch(packet_request)
425
 switch(packet_request)
426
 {
426
 {
427
  case HOTT_VARIO_PACKET_ID:
427
  case HOTT_VARIO_PACKET_ID:
428
                if(GPSPacket.WarnBeep == SpeechMessage) SpeechMessage = HoTT_Waring(); // Achtung: das ist richtig hier, damit der Varioton schon vorher abgestellt wird
428
                if(GPSPacket.WarnBeep == SpeechMessage) SpeechMessage = HoTT_Waring(); // Achtung: das ist richtig hier, damit der Varioton schon vorher abgestellt wird
429
 
429
 
430
                VarioPacket.Altitude = HoehenWert/100 + 500;  
430
                VarioPacket.Altitude = HoehenWert/100 + 500;  
431
                if(!SpeechMessage) VarioPacket.m_sec = BuildHoTT_Vario(); else VarioPacket.m_sec = VARIO_ZERO;
431
                if(!SpeechMessage) VarioPacket.m_sec = BuildHoTT_Vario(); else VarioPacket.m_sec = VARIO_ZERO;
432
                VarioPacket.m_3sec = VarioPacket.m_sec;
432
                VarioPacket.m_3sec = VarioPacket.m_sec;
433
                VarioPacket.m_10sec = VarioPacket.m_sec;
433
                VarioPacket.m_10sec = VarioPacket.m_sec;
434
                if (VarioPacket.Altitude < VarioPacket.MinAltitude) VarioPacket.MinAltitude = VarioPacket.Altitude;
434
                if (VarioPacket.Altitude < VarioPacket.MinAltitude) VarioPacket.MinAltitude = VarioPacket.Altitude;
435
                if (VarioPacket.Altitude > VarioPacket.MaxAltitude) VarioPacket.MaxAltitude = VarioPacket.Altitude;            
435
                if (VarioPacket.Altitude > VarioPacket.MaxAltitude) VarioPacket.MaxAltitude = VarioPacket.Altitude;            
436
                VarioPacket.WarnBeep = 0;//HoTT_Waring();
436
                VarioPacket.WarnBeep = 0;//HoTT_Waring();
437
                HoTT_DataPointer = (unsigned char *) &VarioPacket;
437
                HoTT_DataPointer = (unsigned char *) &VarioPacket;
438
        VarioPacket.FreeCharacters[0] = VarioCharacter;
438
        VarioPacket.FreeCharacters[0] = VarioCharacter;
439
    if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) VarioPacket.FreeCharacters[1] = 'C'; else VarioPacket.FreeCharacters[1] = ' ';
439
    if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) VarioPacket.FreeCharacters[1] = 'C'; else VarioPacket.FreeCharacters[1] = ' ';
440
//      VarioPacket.FreeCharacters[2] = ' ';
440
//      VarioPacket.FreeCharacters[2] = ' ';
441
    if(NC_ErrorCode)
441
    if(NC_ErrorCode)
442
         {
442
         {
443
                VarioPacket.Text[0] = NC_ErrorCode/10 + '0';
443
                VarioPacket.Text[0] = NC_ErrorCode/10 + '0';
444
                VarioPacket.Text[1] = NC_ErrorCode%10 + '0';
444
                VarioPacket.Text[1] = NC_ErrorCode%10 + '0';
445
                VarioPacket.Text[2] = ':';
445
                VarioPacket.Text[2] = ':';
446
                for(i=0; i<16;i++) VarioPacket.Text[i+3] = pgm_read_byte(&NC_ERROR_TEXT[NC_ErrorCode][i]);
446
                for(i=0; i<16;i++) VarioPacket.Text[i+3] = pgm_read_byte(&NC_ERROR_TEXT[NC_ErrorCode][i]);
447
                VarioPacket.Text[19] = ' ';
447
                VarioPacket.Text[19] = ' ';
448
                VarioPacket.Text[20] = ' ';
448
                VarioPacket.Text[20] = ' ';
449
         }
449
         }
450
         else
450
         else
-
 
451
        if(Partner_ErrorCode)
-
 
452
        {
-
 
453
                if(IamMaster == SLAVE)
-
 
454
         {
-
 
455
                        VarioPacket.Text[0] = 'M';
-
 
456
                        VarioPacket.Text[1] = 'A';
-
 
457
                 }     
-
 
458
                 else
-
 
459
         {
-
 
460
                        VarioPacket.Text[0] = 'S';
-
 
461
                        VarioPacket.Text[1] = 'L';
-
 
462
                 }     
-
 
463
                VarioPacket.Text[2] = Partner_ErrorCode/10 + '0';
-
 
464
                VarioPacket.Text[3] = Partner_ErrorCode%10 + '0';
-
 
465
                VarioPacket.Text[4] = ':';
-
 
466
                for(i=0; i<16;i++) VarioPacket.Text[i+5] = pgm_read_byte(&NC_ERROR_TEXT[Partner_ErrorCode][i]);
-
 
467
        }
-
 
468
        else
451
         if(ShowCmpsCalibrateTime)
469
         if(ShowCmpsCalibrateTime)
452
         {
470
         {
453
          for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&CALIBRATE_TEXT[WinkelOut.CalcState][i]);
471
          for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&CALIBRATE_TEXT[WinkelOut.CalcState][i]);
454
         }
472
         }
455
         else    
473
         else    
456
         if(LowVoltageLandingActive) for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&LANDING[i]); // no Error
474
         if(LowVoltageLandingActive) for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&LANDING[i]); // no Error
457
     else
475
     else
458
         if(FC_StatusFlags & FC_STATUS_LOWBAT) for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&UNDERVOLTAGE[i]); // no Error
476
         if(FC_StatusFlags & FC_STATUS_LOWBAT) for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&UNDERVOLTAGE[i]); // no Error
459
         else
477
         else
460
         if(ShowSettingNameTime) // no Error
478
         if(ShowSettingNameTime) // no Error
461
         {                  
479
         {                  
462
          for(i=0; i<sizeof(SETTING);i++) VarioPacket.Text[i] = pgm_read_byte(&SETTING[i]);
480
          for(i=0; i<sizeof(SETTING);i++) VarioPacket.Text[i] = pgm_read_byte(&SETTING[i]);
463
      VarioPacket.Text[4] = '0' + ActiveParamSet;
481
      VarioPacket.Text[4] = '0' + ActiveParamSet;
464
          for(i=0; i<sizeof(EE_Parameter.Name);i++) VarioPacket.Text[i+7] = EE_Parameter.Name[i]; // no Error
482
          for(i=0; i<sizeof(EE_Parameter.Name);i++) VarioPacket.Text[i+7] = EE_Parameter.Name[i]; // no Error
465
      if(FC_StatusFlags3 & FC_STATUS3_BOAT)
483
      if(FC_StatusFlags3 & FC_STATUS3_BOAT)
466
                {
484
                {
467
         VarioPacket.Text[17] = 'B';
485
         VarioPacket.Text[17] = 'B';
468
         VarioPacket.Text[18] = 'O';
486
         VarioPacket.Text[18] = 'O';
469
         VarioPacket.Text[19] = 'A';
487
         VarioPacket.Text[19] = 'A';
470
         VarioPacket.Text[20] = 'T';
488
         VarioPacket.Text[20] = 'T';
471
                }
489
                }
472
          else
490
          else
473
                {
491
                {
474
         VarioPacket.Text[18] = ' ';
492
         VarioPacket.Text[18] = ' ';
475
         VarioPacket.Text[19] = ' ';
493
         VarioPacket.Text[19] = ' ';
476
         VarioPacket.Text[20] = ' ';
494
         VarioPacket.Text[20] = ' ';
477
                }
495
                }
478
         }
496
         }
479
         else
497
         else
480
         if(Show_Store_Time)
498
         if(Show_Store_Time)
481
         {
499
         {
482
          for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&STORE[i]); // no Error and not calibrated
500
          for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&STORE[i]); // no Error and not calibrated
483
          if(Show_Store_Value < 10) VarioPacket.Text[18] = Show_Store_Value + '0';
501
          if(Show_Store_Value < 10) VarioPacket.Text[18] = Show_Store_Value + '0';
484
          else
502
          else
485
          {
503
          {
486
           VarioPacket.Text[18] = Show_Store_Value/10 + '0';
504
           VarioPacket.Text[18] = Show_Store_Value/10 + '0';
487
           VarioPacket.Text[19] = Show_Store_Value%10 + '0';
505
           VarioPacket.Text[19] = Show_Store_Value%10 + '0';
488
          }
506
          }
489
         }
507
         }
490
         else    
508
         else    
491
         if(Show_Load_Time)
509
         if(Show_Load_Time)
492
         {
510
         {
493
          for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&LOAD[i]); // no Error and not calibrated
511
          for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&LOAD[i]); // no Error and not calibrated
494
          if(Show_Load_Value < 10) VarioPacket.Text[17] = Show_Load_Value + '0';
512
          if(Show_Load_Value < 10) VarioPacket.Text[17] = Show_Load_Value + '0';
495
          else
513
          else
496
          {
514
          {
497
           VarioPacket.Text[17] = Show_Load_Value/10 + '0';
515
           VarioPacket.Text[17] = Show_Load_Value/10 + '0';
498
           VarioPacket.Text[18] = Show_Load_Value%10 + '0';
516
           VarioPacket.Text[18] = Show_Load_Value%10 + '0';
499
          }
517
          }
500
         }
518
         }
501
         else    
519
         else    
502
     if(NaviData_WaypointNumber)
520
     if(NaviData_WaypointNumber)
503
         {    
521
         {    
504
          unsigned int tmp_int;
522
          unsigned int tmp_int;
505
      unsigned char tmp;
523
      unsigned char tmp;
506
      VarioPacket.Text[0] = 'W'; VarioPacket.Text[1] = 'P';
524
      VarioPacket.Text[0] = 'W'; VarioPacket.Text[1] = 'P';
507
      VarioPacket.Text[2] = ' ';
525
      VarioPacket.Text[2] = ' ';
508
      VarioPacket.Text[3] = '0'+(NaviData_WaypointIndex) / 10;
526
      VarioPacket.Text[3] = '0'+(NaviData_WaypointIndex) / 10;
509
      VarioPacket.Text[4] = '0'+(NaviData_WaypointIndex) % 10;
527
      VarioPacket.Text[4] = '0'+(NaviData_WaypointIndex) % 10;
510
      VarioPacket.Text[5] = '/';
528
      VarioPacket.Text[5] = '/';
511
      VarioPacket.Text[6] = '0'+(NaviData_WaypointNumber) / 10;
529
      VarioPacket.Text[6] = '0'+(NaviData_WaypointNumber) / 10;
512
      VarioPacket.Text[7] = '0'+(NaviData_WaypointNumber) % 10;
530
      VarioPacket.Text[7] = '0'+(NaviData_WaypointNumber) % 10;
513
      VarioPacket.Text[8] = ' ';
531
      VarioPacket.Text[8] = ' ';
514
          tmp_int = NaviData_TargetDistance;
532
          tmp_int = NaviData_TargetDistance;
515
      if(tmp_int > 1000) { VarioPacket.Text[9] = '0'+(tmp_int) / 1000; tmp_int %= 1000;}
533
      if(tmp_int > 1000) { VarioPacket.Text[9] = '0'+(tmp_int) / 1000; tmp_int %= 1000;}
516
          else VarioPacket.Text[9] = ' ';
534
          else VarioPacket.Text[9] = ' ';
517
      if(tmp_int > 100) { VarioPacket.Text[10] = '0'+(tmp_int) / 100; tmp_int %= 100;}
535
      if(tmp_int > 100) { VarioPacket.Text[10] = '0'+(tmp_int) / 100; tmp_int %= 100;}
518
          else VarioPacket.Text[10] = ' ';
536
          else VarioPacket.Text[10] = ' ';
519
      VarioPacket.Text[11] = '0'+(tmp_int) / 10;
537
      VarioPacket.Text[11] = '0'+(tmp_int) / 10;
520
      VarioPacket.Text[12] = '0'+(tmp_int) % 10;
538
      VarioPacket.Text[12] = '0'+(tmp_int) % 10;
521
      VarioPacket.Text[13] = 'm';
539
      VarioPacket.Text[13] = 'm';
522
      VarioPacket.Text[14] = ' ';
540
      VarioPacket.Text[14] = ' ';
523
      tmp = NaviData_TargetHoldTime;
541
      tmp = NaviData_TargetHoldTime;
524
          if(tmp > 100) { VarioPacket.Text[15] = '0'+(tmp) / 100; tmp %= 100;} else VarioPacket.Text[15] = ' ';
542
          if(tmp > 100) { VarioPacket.Text[15] = '0'+(tmp) / 100; tmp %= 100;} else VarioPacket.Text[15] = ' ';
525
      VarioPacket.Text[16] = '0'+(tmp) / 10;
543
      VarioPacket.Text[16] = '0'+(tmp) / 10;
526
      VarioPacket.Text[17] = '0'+(tmp) % 10;
544
      VarioPacket.Text[17] = '0'+(tmp) % 10;
527
      VarioPacket.Text[18] = 's';
545
      VarioPacket.Text[18] = 's';
528
      VarioPacket.Text[19] = ' ';
546
      VarioPacket.Text[19] = ' ';
529
      VarioPacket.Text[20] = ' ';
547
      VarioPacket.Text[20] = ' ';
530
         }
548
         }
531
         else
549
         else
532
         if(NC_To_FC_Flags & NC_TO_FC_SIMULATION_ACTIVE)
550
         if(NC_To_FC_Flags & NC_TO_FC_SIMULATION_ACTIVE)
533
         {
551
         {
534
          for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&SIMULATION[i]);
552
          for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&SIMULATION[i]);
535
         }
553
         }
536
         else
554
         else
537
         if(!CalibrationDone)
555
         if(!CalibrationDone)
538
         {
556
         {
539
          for(i=0; i<17;i++) VarioPacket.Text[i] = pgm_read_byte(&MIKROKOPTER[i+2]); // no Error and not calibrated
557
          for(i=0; i<17;i++) VarioPacket.Text[i] = pgm_read_byte(&MIKROKOPTER[i+2]); // no Error and not calibrated
540
      VarioPacket.Text[16] = '0'+VERSION_MAJOR;
558
      VarioPacket.Text[16] = '0'+VERSION_MAJOR;
541
      VarioPacket.Text[17] = '.';
559
      VarioPacket.Text[17] = '.';
542
      VarioPacket.Text[18] = '0'+VERSION_MINOR/10;
560
      VarioPacket.Text[18] = '0'+VERSION_MINOR/10;
543
      VarioPacket.Text[19] = '0'+VERSION_MINOR%10;
561
      VarioPacket.Text[19] = '0'+VERSION_MINOR%10;
544
      VarioPacket.Text[20] = 'a'+VERSION_PATCH;
562
      VarioPacket.Text[20] = 'a'+VERSION_PATCH;
545
         }
563
         }
546
         else
564
         else
547
         {
565
         {
548
          if(FC_StatusFlags3 & FC_STATUS3_BOAT) for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&BOAT_MODE[i]); // no Error
566
          if(FC_StatusFlags3 & FC_STATUS3_BOAT) for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&BOAT_MODE[i]); // no Error
549
          else  for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&MIKROKOPTER[i]); // no Error
567
          else  for(i=0; i<21;i++) VarioPacket.Text[i] = pgm_read_byte(&MIKROKOPTER[i]); // no Error
550
          if(FC_StatusFlags3 & FC_STATUS3_REDUNDANCE_AKTIVE)  VarioPacket.Text[0] = 'R';
568
          if(FC_StatusFlags3 & FC_STATUS3_REDUNDANCE_AKTIVE)  VarioPacket.Text[0] = 'R';
551
         }
569
         }
552
                return(sizeof(VarioPacket));
570
                return(sizeof(VarioPacket));
553
                break;
571
                break;
554
 
572
 
555
  case HOTT_GPS_PACKET_ID:
573
  case HOTT_GPS_PACKET_ID:
556
                GPSPacket.Altitude = HoehenWert/100 + 500;  
574
                GPSPacket.Altitude = HoehenWert/100 + 500;  
557
//              GPSPacket.Distance = GPSInfo.HomeDistance/10;  // macht die NC
575
//              GPSPacket.Distance = GPSInfo.HomeDistance/10;  // macht die NC
558
//              GPSPacket.Heading = GPSInfo.HomeBearing/2;     // macht die NC
576
//              GPSPacket.Heading = GPSInfo.HomeBearing/2;     // macht die NC
559
//              GPSPacket.Speed = (GPSInfo.Speed * 36) / 10;   // macht die NC
577
//              GPSPacket.Speed = (GPSInfo.Speed * 36) / 10;   // macht die NC
560
                GPSPacket.WarnBeep = SpeechMessage;
578
                GPSPacket.WarnBeep = SpeechMessage;
561
                if(!GPSPacket.WarnBeep) GPSPacket.m_sec = BuildHoTT_Vario(); else GPSPacket.m_sec = VARIO_ZERO;
579
                if(!GPSPacket.WarnBeep) GPSPacket.m_sec = BuildHoTT_Vario(); else GPSPacket.m_sec = VARIO_ZERO;
562
                GPSPacket.m_3sec = 120;
580
                GPSPacket.m_3sec = 120;
563
                GPSPacket.NumOfSats = GPSInfo.NumOfSats;
581
                GPSPacket.NumOfSats = GPSInfo.NumOfSats;
564
                if(GPSInfo.Flags & FLAG_DIFFSOLN) GPSPacket.SatFix = 'D';
582
                if(GPSInfo.Flags & FLAG_DIFFSOLN) GPSPacket.SatFix = 'D';
565
                else
583
                else
566
        if(GPSInfo.SatFix == SATFIX_3D) GPSPacket.SatFix = ' ';
584
        if(GPSInfo.SatFix == SATFIX_3D) GPSPacket.SatFix = ' ';
567
                else GPSPacket.SatFix = '!';
585
                else GPSPacket.SatFix = '!';
568
                HoTT_DataPointer = (unsigned char *) &GPSPacket;
586
                HoTT_DataPointer = (unsigned char *) &GPSPacket;
569
                GPSPacket.FreeCharacters[0] = NC_GPS_ModeCharacter;
587
                GPSPacket.FreeCharacters[0] = NC_GPS_ModeCharacter;
570
                GPSPacket.FreeCharacters[2] = GPSPacket.SatFix;
588
                GPSPacket.FreeCharacters[2] = GPSPacket.SatFix;
571
                GPSPacket.HomeDirection = GPSInfo.HomeBearing / 2;//230;
589
                GPSPacket.HomeDirection = GPSInfo.HomeBearing / 2;//230;
572
                return(sizeof(GPSPacket));  
590
                return(sizeof(GPSPacket));  
573
                break;
591
                break;
574
  case HOTT_ELECTRIC_AIR_PACKET_ID:
592
  case HOTT_ELECTRIC_AIR_PACKET_ID:
575
                GetHottestBl();
593
                GetHottestBl();
576
                ElectricAirPacket.Altitude = HoehenWert/100 + 500;
594
                ElectricAirPacket.Altitude = HoehenWert/100 + 500;
577
                ElectricAirPacket.Battery1 = UBat;
595
                ElectricAirPacket.Battery1 = UBat;
578
                ElectricAirPacket.Battery2 = UBat;
596
                ElectricAirPacket.Battery2 = UBat;
579
                ElectricAirPacket.VoltageCell1 = CompassCorrected / 2;
597
                ElectricAirPacket.VoltageCell1 = CompassCorrected / 2;
580
                ElectricAirPacket.VoltageCell8 = ElectricAirPacket.VoltageCell1;
598
                ElectricAirPacket.VoltageCell8 = ElectricAirPacket.VoltageCell1;
581
                ElectricAirPacket.VoltageCell6 = GPSInfo.HomeBearing / 2;
599
                ElectricAirPacket.VoltageCell6 = GPSInfo.HomeBearing / 2;
582
                ElectricAirPacket.VoltageCell7 = GPSInfo.HomeDistance/20;
600
                ElectricAirPacket.VoltageCell7 = GPSInfo.HomeDistance/20;
583
                ElectricAirPacket.VoltageCell13 = ElectricAirPacket.VoltageCell6;
601
                ElectricAirPacket.VoltageCell13 = ElectricAirPacket.VoltageCell6;
584
                ElectricAirPacket.VoltageCell14 = ElectricAirPacket.VoltageCell7;
602
                ElectricAirPacket.VoltageCell14 = ElectricAirPacket.VoltageCell7;
585
        if(!SpeechMessage) ElectricAirPacket.m_sec = BuildHoTT_Vario(); else ElectricAirPacket.m_sec = VARIO_ZERO;
603
        if(!SpeechMessage) ElectricAirPacket.m_sec = BuildHoTT_Vario(); else ElectricAirPacket.m_sec = VARIO_ZERO;
586
                ElectricAirPacket.m_3sec = 120;
604
                ElectricAirPacket.m_3sec = 120;
587
                ElectricAirPacket.InputVoltage = UBat;
605
                ElectricAirPacket.InputVoltage = UBat;
588
                ElectricAirPacket.Temperature1 = MinBlTemperture + 20;
606
                ElectricAirPacket.Temperature1 = MinBlTemperture + 20;
589
                ElectricAirPacket.Temperature2 = MaxBlTemperture + 20;
607
                ElectricAirPacket.Temperature2 = MaxBlTemperture + 20;
590
                ElectricAirPacket.Capacity = Capacity.UsedCapacity/10;
608
                ElectricAirPacket.Capacity = Capacity.UsedCapacity/10;
591
                ElectricAirPacket.WarnBeep = 0;//HoTT_Waring();
609
                ElectricAirPacket.WarnBeep = 0;//HoTT_Waring();
592
//ElectricAirPacket.WarnBeep = SpeechMessage;
610
//ElectricAirPacket.WarnBeep = SpeechMessage;
593
                ElectricAirPacket.Current = Capacity.ActualCurrent;
611
                ElectricAirPacket.Current = Capacity.ActualCurrent;
594
                HoTT_DataPointer = (unsigned char *) &ElectricAirPacket;
612
                HoTT_DataPointer = (unsigned char *) &ElectricAirPacket;
595
                ElectricAirPacket.FlightTimeMinutes = FlugSekunden / 60;
613
                ElectricAirPacket.FlightTimeMinutes = FlugSekunden / 60;
596
                ElectricAirPacket.FlightTimeSeconds = FlugSekunden % 60;
614
                ElectricAirPacket.FlightTimeSeconds = FlugSekunden % 60;
597
                return(sizeof(ElectricAirPacket));
615
                return(sizeof(ElectricAirPacket));
598
                break;
616
                break;
599
  case HOTT_GENERAL_PACKET_ID:
617
  case HOTT_GENERAL_PACKET_ID:
600
                GetHottestBl();
618
                GetHottestBl();
601
                HoTTGeneral.Rpm = GPSInfo.HomeDistance/100;
619
                HoTTGeneral.Rpm = GPSInfo.HomeDistance/100;
602
                HoTTGeneral.VoltageCell1 = CompassCorrected / 2;
620
                HoTTGeneral.VoltageCell1 = CompassCorrected / 2;
603
                HoTTGeneral.VoltageCell2 = KompassValue / 2;
621
                HoTTGeneral.VoltageCell2 = KompassValue / 2;
604
                //HoTTGeneral.VoltageCell3 = Magnetstaerke -> macht NC
622
                //HoTTGeneral.VoltageCell3 = Magnetstaerke -> macht NC
605
                //HoTTGeneral.VoltageCell4 = Inclinition -> macht NC
623
                //HoTTGeneral.VoltageCell4 = Inclinition -> macht NC
606
                HoTTGeneral.VoltageCell5 = DebugOut.Analog[28]; // I2C ErrorCounter
624
                HoTTGeneral.VoltageCell5 = DebugOut.Analog[28]; // I2C ErrorCounter
607
                HoTTGeneral.VoltageCell6 = GPSInfo.HomeBearing / 2;
625
                HoTTGeneral.VoltageCell6 = GPSInfo.HomeBearing / 2;
608
                if(UBat > BattLowVoltageWarning + 2) HoTTGeneral.FuelPercent = (UBat - (BattLowVoltageWarning + 2)) * 3;
626
                if(UBat > BattLowVoltageWarning + 2) HoTTGeneral.FuelPercent = (UBat - (BattLowVoltageWarning + 2)) * 3;
609
                else HoTTGeneral.FuelPercent = 0;
627
                else HoTTGeneral.FuelPercent = 0;
610
                if(HoTTGeneral.FuelPercent > 100) HoTTGeneral.FuelPercent = 100;
628
                if(HoTTGeneral.FuelPercent > 100) HoTTGeneral.FuelPercent = 100;
611
                HoTTGeneral.FuelCapacity = NC_ErrorCode;//HoehenWert/100; // Oelpegel
629
                HoTTGeneral.FuelCapacity = NC_ErrorCode;//HoehenWert/100; // Oelpegel
612
//              if(HoTTGeneral.FuelCapacity < 0) HoTTGeneral.FuelCapacity = 0;
630
//              if(HoTTGeneral.FuelCapacity < 0) HoTTGeneral.FuelCapacity = 0;
613
                HoTTGeneral.Altitude = HoehenWert/100 + 500;
631
                HoTTGeneral.Altitude = HoehenWert/100 + 500;
614
                HoTTGeneral.Battery1 = UBat;
632
                HoTTGeneral.Battery1 = UBat;
615
                HoTTGeneral.Battery2 = UBat;
633
                HoTTGeneral.Battery2 = UBat;
616
                if(!SpeechMessage) HoTTGeneral.m_sec =  BuildHoTT_Vario(); else  HoTTGeneral.m_sec = VARIO_ZERO;
634
                if(!SpeechMessage) HoTTGeneral.m_sec =  BuildHoTT_Vario(); else  HoTTGeneral.m_sec = VARIO_ZERO;
617
                HoTTGeneral.m_3sec = 120 + SpeechMessage;
635
                HoTTGeneral.m_3sec = 120 + SpeechMessage;
618
                HoTTGeneral.InputVoltage = UBat;
636
                HoTTGeneral.InputVoltage = UBat;
619
                HoTTGeneral.Temperature1 = MinBlTemperture + 20;
637
                HoTTGeneral.Temperature1 = MinBlTemperture + 20;
620
                HoTTGeneral.Temperature2 = MaxBlTemperture + 20;
638
                HoTTGeneral.Temperature2 = MaxBlTemperture + 20;
621
                HoTTGeneral.Capacity = Capacity.UsedCapacity/10;
639
                HoTTGeneral.Capacity = Capacity.UsedCapacity/10;
622
HoTTGeneral.WarnBeep = 0;
640
HoTTGeneral.WarnBeep = 0;
623
                HoTTGeneral.Current = Capacity.ActualCurrent;
641
                HoTTGeneral.Current = Capacity.ActualCurrent;
624
//HoTTGeneral.ErrorNumber = HoTTErrorCode();
642
//HoTTGeneral.ErrorNumber = HoTTErrorCode();
625
                HoTT_DataPointer = (unsigned char *) &HoTTGeneral;
643
                HoTT_DataPointer = (unsigned char *) &HoTTGeneral;
626
                return(sizeof(HoTTGeneral));
644
                return(sizeof(HoTTGeneral));
627
                break;
645
                break;
628
  default: return(0);
646
  default: return(0);
629
  }            
647
  }            
630
}
648
}
631
 
649
 
632
//---------------------------------------------------------------
650
//---------------------------------------------------------------
633
void HoTT_Menu(void)
651
void HoTT_Menu(void)
634
{
652
{
635
 static unsigned char line, page = 0,show_current = 0,show_mag = 0, show_poti = 0,hyterese = 1;
653
 static unsigned char line, page = 0,show_current = 0,show_mag = 0, show_poti = 0,hyterese = 1;
636
 HoTTVarioMeter = (HoTTVarioMeter * 7 + VarioMeter) / 8;
654
 HoTTVarioMeter = (HoTTVarioMeter * 7 + VarioMeter) / 8;
637
 static int delay;
655
 static int delay;
638
 
656
 
639
// if(HottKeyboard) {beeptime = 1000;};  
657
// if(HottKeyboard) {beeptime = 1000;};  
640
 
658
 
641
 switch(page)
659
 switch(page)
642
 {
660
 {
643
  case 0:
661
  case 0:
644
  switch(line++)
662
  switch(line++)
645
  {
663
  {
646
        case 0:  
664
        case 0:  
647
                if(FC_StatusFlags & FC_STATUS_LOWBAT)
665
                if(FC_StatusFlags & FC_STATUS_LOWBAT)
648
                         HoTT_printfxy_BLINK(0,0,"  %2i.%1iV  ",UBat/10, UBat%10)
666
                         HoTT_printfxy_BLINK(0,0,"  %2i.%1iV  ",UBat/10, UBat%10)
649
                        else
667
                        else
650
                         HoTT_printfxy(0,0,"  %2i.%1iV  ",UBat/10, UBat%10)
668
                         HoTT_printfxy(0,0,"  %2i.%1iV  ",UBat/10, UBat%10)
651
 
669
 
652
                        if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG)
670
                        if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG)
653
                          {
671
                          {
654
                           if(HoehenReglerAktiv)        HoTT_printfxy_INV(10,0,"ALT:%4im %c", (int16_t)(HoehenWert/100),VarioCharacter)
672
                           if(HoehenReglerAktiv)        HoTT_printfxy_INV(10,0,"ALT:%4im %c", (int16_t)(HoehenWert/100),VarioCharacter)
655
                           else                                         HoTT_printfxy(10,0,"ALT:%4im  ", (int16_t)(HoehenWert/100))
673
                           else                                         HoTT_printfxy(10,0,"ALT:%4im  ", (int16_t)(HoehenWert/100))
656
                           }
674
                           }
657
            else    HoTT_printfxy(10,0,"ALT:---- ");
675
            else    HoTT_printfxy(10,0,"ALT:---- ");
658
                        break;
676
                        break;
659
        case 1:  
677
        case 1:  
660
                if(FC_StatusFlags & FC_STATUS_LOWBAT)
678
                if(FC_StatusFlags & FC_STATUS_LOWBAT)
661
                         HoTT_printfxy_BLINK(0,1,"  %2i:%02i  ",FlugSekunden/60,FlugSekunden%60)
679
                         HoTT_printfxy_BLINK(0,1,"  %2i:%02i  ",FlugSekunden/60,FlugSekunden%60)
662
            else   HoTT_printfxy(0,1,"  %2i:%02i  ",FlugSekunden/60,FlugSekunden%60);                      
680
            else   HoTT_printfxy(0,1,"  %2i:%02i  ",FlugSekunden/60,FlugSekunden%60);                      
663
                        HoTT_printfxy(10,1,"DIR: %3d%c",CompassCorrected, HoTT_GRAD);
681
                        HoTT_printfxy(10,1,"DIR: %3d%c",CompassCorrected, HoTT_GRAD);
664
                        if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) HoTT_printfxy_INV(20,1,"C") else HoTT_printfxy(20,1," ");
682
                        if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) HoTT_printfxy_INV(20,1,"C") else HoTT_printfxy(20,1," ");
665
            break;
683
            break;
666
        case 2:
684
        case 2:
667
                if(FC_StatusFlags & FC_STATUS_LOWBAT)
685
                if(FC_StatusFlags & FC_STATUS_LOWBAT)
668
                         HoTT_printfxy_BLINK(0,2,"  %5i  ",Capacity.UsedCapacity)
686
                         HoTT_printfxy_BLINK(0,2,"  %5i  ",Capacity.UsedCapacity)
669
            else   HoTT_printfxy(0,2,"  %5i  ",Capacity.UsedCapacity);                     
687
            else   HoTT_printfxy(0,2,"  %5i  ",Capacity.UsedCapacity);                     
670
                        HoTT_printfxy(12,2,"I:%2i.%1iA ",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10);
688
                        HoTT_printfxy(12,2,"I:%2i.%1iA ",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10);
671
                        break;
689
                        break;
672
        case 3:
690
        case 3:
673
                        HoTT_printfxy(9,0,":");
691
                        HoTT_printfxy(9,0,":");
674
                        HoTT_printfxy(9,1,":");
692
                        HoTT_printfxy(9,1,":");
675
                        HoTT_printfxy(9,2,":");
693
                        HoTT_printfxy(9,2,":");
676
                        HoTT_printfxy(0,3,"---------+-----------");
694
                        HoTT_printfxy(0,3,"---------+-----------");
677
 
695
 
678
//                      HoTT_printfxy(0,3,"---------------------");
696
//                      HoTT_printfxy(0,3,"---------------------");
679
                        HoTT_printfxy(0,6,"---------------------");
697
                        HoTT_printfxy(0,6,"---------------------");
680
                        break;
698
                        break;
681
        case 4:  
699
        case 4:  
682
                        if(NaviDataOkay)
700
                        if(NaviDataOkay)
683
                        {
701
                        {
684
                                HoTT_printfxy(9,4,":");
702
                                HoTT_printfxy(9,4,":");
685
                                HoTT_printfxy(0,4,"SAT:%2d ",GPSInfo.NumOfSats);
703
                                HoTT_printfxy(0,4,"SAT:%2d ",GPSInfo.NumOfSats);
686
                            HoTT_printfxy(10,4,"DIST:%3dm",GPSInfo.HomeDistance/10);
704
                            HoTT_printfxy(10,4,"DIST:%3dm",GPSInfo.HomeDistance/10);
687
                                switch (GPSInfo.SatFix)
705
                                switch (GPSInfo.SatFix)
688
                                {
706
                                {
689
                                        case SATFIX_3D:
707
                                        case SATFIX_3D:
690
                                                        if(GPSInfo.Flags & FLAG_DIFFSOLN) HoTT_printfxy(7,4,"D ")
708
                                                        if(GPSInfo.Flags & FLAG_DIFFSOLN) HoTT_printfxy(7,4,"D ")
691
                                                        else HoTT_printfxy(7,4,"3D");
709
                                                        else HoTT_printfxy(7,4,"3D");
692
                                                break;
710
                                                break;
693
                                        default:
711
                                        default:
694
                                                HoTT_printfxy_BLINK(7,4,"!!");
712
                                                HoTT_printfxy_BLINK(7,4,"!!");
695
                                                break;
713
                                                break;
696
                                }      
714
                                }      
697
                        }
715
                        }
698
                        else
716
                        else
699
                        {                    
717
                        {                    
700
                                Hott_ClearLine(4);
718
                                Hott_ClearLine(4);
701
                        }
719
                        }
702
                        break;
720
                        break;
703
        case 5:
721
        case 5:
704
                        if(NaviDataOkay)
722
                        if(NaviDataOkay)
705
                        {
723
                        {
706
                        if(show_mag)
724
                        if(show_mag)
707
                          {
725
                          {
708
                                HoTT_printfxy(0,5,"MAG:%3u%% ",EarthMagneticField);
726
                                HoTT_printfxy(0,5,"MAG:%3u%% ",EarthMagneticField);
709
                            HoTT_printfxy(12,5,"HM:%3d%c %c", GPSInfo.HomeBearing, HoTT_GRAD, NC_GPS_ModeCharacter);
727
                            HoTT_printfxy(12,5,"HM:%3d%c %c", GPSInfo.HomeBearing, HoTT_GRAD, NC_GPS_ModeCharacter);
710
                                HoTT_printfxy(9,5,"incl:%2d%c(%2i)",EarthMagneticInclination, HoTT_GRAD,EarthMagneticInclinationTheoretic);
728
                                HoTT_printfxy(9,5,"incl:%2d%c(%2i)",EarthMagneticInclination, HoTT_GRAD,EarthMagneticInclinationTheoretic);
711
              }
729
              }
712
                         else
730
                         else
713
                          {
731
                          {
714
                                HoTT_printfxy(0,5,"    %2um/s:  HM:%3d%c %c",GPSInfo.Speed, GPSInfo.HomeBearing, HoTT_GRAD, NC_GPS_ModeCharacter);
732
                                HoTT_printfxy(0,5,"    %2um/s:  HM:%3d%c %c",GPSInfo.Speed, GPSInfo.HomeBearing, HoTT_GRAD, NC_GPS_ModeCharacter);
715
                          }    
733
                          }    
716
            }
734
            }
717
                        else Hott_ClearLine(5);
735
                        else Hott_ClearLine(5);
718
                        break;
736
                        break;
719
        case 6:
737
        case 6:
720
                        break;
738
                        break;
721
        case 7: if(NC_ErrorCode)
739
        case 7: if(NC_ErrorCode)
722
                  {
740
                  {
723
                           if(HoTTBlink && NC_ErrorCode < MAX_ERR_NUMBER)
741
                           if(HoTTBlink && NC_ErrorCode < MAX_ERR_NUMBER)
724
                            {
742
                            {
725
                             Hott_ClearLine(7);
743
                             Hott_ClearLine(7);
726
                             HoTT_printfxy_INV(0,7,"ERR: %2d !",NC_ErrorCode);
744
                             HoTT_printfxy_INV(0,7,"ERR: %2d !",NC_ErrorCode);
727
                            }
745
                            }
728
                                else
746
                                else
729
                                {
747
                                {
730
                                 HoTT_printfxy(0,7,"ERR: ");     _printf_P(&LIBFC_HoTT_Putchar, NC_ERROR_TEXT[NC_ErrorCode] , 0);};
748
                                 HoTT_printfxy(0,7,"ERR: ");     _printf_P(&LIBFC_HoTT_Putchar, NC_ERROR_TEXT[NC_ErrorCode] , 0);};
731
                                }
749
                                }
732
                        else
750
                        else
733
                        if(FC_StatusFlags & FC_STATUS_LOWBAT) HoTT_printfxy(1,7,"!! LiPo voltage !!")
751
                        if(FC_StatusFlags & FC_STATUS_LOWBAT) HoTT_printfxy(1,7,"!! LiPo voltage !!")
734
                        else HoTT_printfxy(0,7," www.MikroKopter.de  ");
752
                        else HoTT_printfxy(0,7," www.MikroKopter.de  ");
735
                        break;
753
                        break;
736
        case 8: //ASCIIPacket.WarnBeep = HoTT_Waring();
754
        case 8: //ASCIIPacket.WarnBeep = HoTT_Waring();
737
                        // ASCIIPacket.WarnBeep = Parameter_UserParam1;
755
                        // ASCIIPacket.WarnBeep = Parameter_UserParam1;
738
        case 9:
756
        case 9:
739
        case 10:
757
        case 10:
740
        case 11:
758
        case 11:
741
        case 12:
759
        case 12:
742
        case 13:
760
        case 13:
743
        case 14:  
761
        case 14:  
744
        case 15:  
762
        case 15:  
745
        case 16:  
763
        case 16:  
746
                        if(HottKeyboard == HOTT_KEY_DOWN) { LIBFC_HoTT_Clear(); page = 5; line = 0;}
764
                        if(HottKeyboard == HOTT_KEY_DOWN) { LIBFC_HoTT_Clear(); page = 5; line = 0;}
747
                        else
765
                        else
748
                        if(HottKeyboard == HOTT_KEY_SET) { if(show_mag) show_mag = 0; else show_mag = 1;}
766
                        if(HottKeyboard == HOTT_KEY_SET) { if(show_mag) show_mag = 0; else show_mag = 1;}
749
                        else
767
                        else
750
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page = 1; line = 0;};
768
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page = 1; line = 0;};
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 1:
775
  case 1:
758
  switch(line++)
776
  switch(line++)
759
  {
777
  {
760
        case 0:  
778
        case 0:  
761
                if(FC_StatusFlags & FC_STATUS_LOWBAT)
779
                if(FC_StatusFlags & FC_STATUS_LOWBAT)
762
                         HoTT_printfxy_BLINK(0,0," %2i:%02i  %2i.%1iV %4imAh",FlugSekunden/60,FlugSekunden%60,UBat/10, UBat%10,Capacity.UsedCapacity)
780
                         HoTT_printfxy_BLINK(0,0," %2i:%02i  %2i.%1iV %4imAh",FlugSekunden/60,FlugSekunden%60,UBat/10, UBat%10,Capacity.UsedCapacity)
763
            else   HoTT_printfxy(0,0," %2i:%02i  %2i.%1iV %4imAh",FlugSekunden/60,FlugSekunden%60,UBat/10, UBat%10,Capacity.UsedCapacity);                         
781
            else   HoTT_printfxy(0,0," %2i:%02i  %2i.%1iV %4imAh",FlugSekunden/60,FlugSekunden%60,UBat/10, UBat%10,Capacity.UsedCapacity);                         
764
                        break;
782
                        break;
765
        case 1:  
783
        case 1:  
766
                        HoTT_printfxy(0,1,"DIR:%3d%c",CompassCorrected, HoTT_GRAD);
784
                        HoTT_printfxy(0,1,"DIR:%3d%c",CompassCorrected, HoTT_GRAD);
767
                        if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG)
785
                        if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG)
768
                          {
786
                          {
769
                           if(HoehenReglerAktiv)        HoTT_printfxy_INV(10,1,"ALT:%4im", (int16_t)(HoehenWert/100))
787
                           if(HoehenReglerAktiv)        HoTT_printfxy_INV(10,1,"ALT:%4im", (int16_t)(HoehenWert/100))
770
                           else                                         HoTT_printfxy(10,1,"ALT:%4im", (int16_t)(HoehenWert/100))
788
                           else                                         HoTT_printfxy(10,1,"ALT:%4im", (int16_t)(HoehenWert/100))
771
                           }
789
                           }
772
            else    HoTT_printfxy(10,1,"ALT:---- ");
790
            else    HoTT_printfxy(10,1,"ALT:---- ");
773
                        HoTT_printfxy(20,1,"%c",VarioCharacter);
791
                        HoTT_printfxy(20,1,"%c",VarioCharacter);
774
            break;
792
            break;
775
        case 2:
793
        case 2:
776
                        if(NaviDataOkay)
794
                        if(NaviDataOkay)
777
                        {
795
                        {
778
                          HoTT_printfxy(1,2,"HM:%3d%c  DIST:%3dm %c", GPSInfo.HomeBearing, HoTT_GRAD, GPSInfo.HomeDistance/10, NC_GPS_ModeCharacter);
796
                          HoTT_printfxy(1,2,"HM:%3d%c  DIST:%3dm %c", GPSInfo.HomeBearing, HoTT_GRAD, GPSInfo.HomeDistance/10, NC_GPS_ModeCharacter);
779
            }
797
            }
780
                        else
798
                        else
781
                        {
799
                        {
782
                         Hott_ClearLine(2);
800
                         Hott_ClearLine(2);
783
                        }
801
                        }
784
                        break;
802
                        break;
785
        case 3:
803
        case 3:
786
                        HoTT_printfxy(0,3,"PWR:%2i.%1iA (%iW) ",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10,Capacity.ActualPower);
804
                        HoTT_printfxy(0,3,"PWR:%2i.%1iA (%iW) ",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10,Capacity.ActualPower);
787
                        if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) HoTT_printfxy_INV(19,3,"CF") else HoTT_printfxy(19,3,"  ");
805
                        if(FC_StatusFlags2 & FC_STATUS2_CAREFREE) HoTT_printfxy_INV(19,3,"CF") else HoTT_printfxy(19,3,"  ");
788
                        break;
806
                        break;
789
        case 4:  
807
        case 4:  
790
                        if(NaviDataOkay)
808
                        if(NaviDataOkay)
791
                        {
809
                        {
792
                                HoTT_printfxy(0,4,"GPS:%2um/s SAT:%d ",GPSInfo.Speed,GPSInfo.NumOfSats);
810
                                HoTT_printfxy(0,4,"GPS:%2um/s SAT:%d ",GPSInfo.Speed,GPSInfo.NumOfSats);
793
                                switch (GPSInfo.SatFix)
811
                                switch (GPSInfo.SatFix)
794
                                {
812
                                {
795
                                        case SATFIX_3D:
813
                                        case SATFIX_3D:
796
                                                HoTT_printfxy(16,4,"  3D ");
814
                                                HoTT_printfxy(16,4,"  3D ");
797
                                                break;
815
                                                break;
798
                                        //case SATFIX_2D:
816
                                        //case SATFIX_2D:
799
                                        //case SATFIX_NONE:
817
                                        //case SATFIX_NONE:
800
                                        default:
818
                                        default:
801
                                                HoTT_printfxy_BLINK(16,4,"NOFIX");
819
                                                HoTT_printfxy_BLINK(16,4,"NOFIX");
802
                                                break;
820
                                                break;
803
                                }      
821
                                }      
804
                                if(GPSInfo.Flags & FLAG_DIFFSOLN)
822
                                if(GPSInfo.Flags & FLAG_DIFFSOLN)
805
                                {
823
                                {
806
                                        HoTT_printfxy(16,4,"DGPS ");
824
                                        HoTT_printfxy(16,4,"DGPS ");
807
                                }
825
                                }
808
                        }
826
                        }
809
                        else
827
                        else
810
                        {                    //012345678901234567890
828
                        {                    //012345678901234567890
811
                                HoTT_printfxy(0,4,"   No NaviCtrl       ");
829
                                HoTT_printfxy(0,4,"   No NaviCtrl       ");
812
                        }
830
                        }
813
                        break;
831
                        break;
814
        case 5:
832
        case 5:
815
                        if(show_current)
833
                        if(show_current)
816
                         {
834
                         {
817
//                              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);
835
//                              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);
818
                                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);
836
                                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);
819
                         }
837
                         }
820
                         else
838
                         else
821
                         {
839
                         {
822
                                HoTT_printfxy(0,5,"%3i %3i %3i %3i%cC", Motor[0].Temperature, Motor[1].Temperature, Motor[2].Temperature, Motor[3].Temperature,HoTT_GRAD);
840
                                HoTT_printfxy(0,5,"%3i %3i %3i %3i%cC", Motor[0].Temperature, Motor[1].Temperature, Motor[2].Temperature, Motor[3].Temperature,HoTT_GRAD);
823
                         }
841
                         }
824
                        break;
842
                        break;
825
        case 6:
843
        case 6:
826
                        if(show_current)
844
                        if(show_current)
827
                         {
845
                         {
828
                    if(RequiredMotors == 4) Hott_ClearLine(6);
846
                    if(RequiredMotors == 4) Hott_ClearLine(6);
829
                                else
847
                                else
830
//                              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)
848
//                              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)
831
                                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)
849
                                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)
832
                                else
850
                                else
833
//                              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);
851
//                              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);
834
                                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);
852
                                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);
835
             }
853
             }
836
                         else
854
                         else
837
                         {
855
                         {
838
                    if(RequiredMotors == 4) Hott_ClearLine(6);
856
                    if(RequiredMotors == 4) Hott_ClearLine(6);
839
                                else
857
                                else
840
                                if(RequiredMotors == 6)  HoTT_printfxy(0,6,"%3i %3i%cC        ", Motor[4].Temperature, Motor[5].Temperature,HoTT_GRAD)
858
                                if(RequiredMotors == 6)  HoTT_printfxy(0,6,"%3i %3i%cC        ", Motor[4].Temperature, Motor[5].Temperature,HoTT_GRAD)
841
                                else
859
                                else
842
                                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);
860
                                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);
843
             }
861
             }
844
                        break;
862
                        break;
845
        case 7: if(NC_ErrorCode)
863
        case 7: if(NC_ErrorCode)
846
                  {
864
                  {
847
                           if(HoTTBlink && NC_ErrorCode < MAX_ERR_NUMBER)
865
                           if(HoTTBlink && NC_ErrorCode < MAX_ERR_NUMBER)
848
                            {
866
                            {
849
                             Hott_ClearLine(7);
867
                             Hott_ClearLine(7);
850
                             HoTT_printfxy_INV(0,7,"ERR: %2d !",NC_ErrorCode);
868
                             HoTT_printfxy_INV(0,7,"ERR: %2d !",NC_ErrorCode);
851
                            }
869
                            }
852
                                else
870
                                else
853
                                {
871
                                {
854
                                 HoTT_printfxy(0,7,"ERR: ");     _printf_P(&LIBFC_HoTT_Putchar, NC_ERROR_TEXT[NC_ErrorCode] , 0);};
872
                                 HoTT_printfxy(0,7,"ERR: ");     _printf_P(&LIBFC_HoTT_Putchar, NC_ERROR_TEXT[NC_ErrorCode] , 0);};
855
                                }
873
                                }
856
                        else
874
                        else
857
                        if(FC_StatusFlags & FC_STATUS_LOWBAT) HoTT_printfxy(1,7,"!! LiPo voltage !!")
875
                        if(FC_StatusFlags & FC_STATUS_LOWBAT) HoTT_printfxy(1,7,"!! LiPo voltage !!")
858
                        else HoTT_printfxy(0,7," www.MikroKopter.de  ");
876
                        else HoTT_printfxy(0,7," www.MikroKopter.de  ");
859
                        break;
877
                        break;
860
        case 8: // ASCIIPacket.WarnBeep = HoTT_Waring();
878
        case 8: // ASCIIPacket.WarnBeep = HoTT_Waring();
861
                        // ASCIIPacket.WarnBeep = Parameter_UserParam1;
879
                        // ASCIIPacket.WarnBeep = Parameter_UserParam1;
862
        case 9:
880
        case 9:
863
        case 10:
881
        case 10:
864
        case 11:
882
        case 11:
865
        case 12:
883
        case 12:
866
        case 13:
884
        case 13:
867
        case 14:  
885
        case 14:  
868
        case 15:  
886
        case 15:  
869
        case 16:  
887
        case 16:  
870
                        if(HottKeyboard == HOTT_KEY_SET) { if(show_current) show_current = 0; else show_current = 1;   Hott_ClearLine(5);  Hott_ClearLine(6);}
888
                        if(HottKeyboard == HOTT_KEY_SET) { if(show_current) show_current = 0; else show_current = 1;   Hott_ClearLine(5);  Hott_ClearLine(6);}
871
                        else
889
                        else
872
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;}
890
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;}
873
                        else
891
                        else
874
                        if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;}
892
                        if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;}
875
//if(HottKeyboard) HoTT_printfxy(15,6,"%KEY:%02x ",HottKeyboard);
893
//if(HottKeyboard) HoTT_printfxy(15,6,"%KEY:%02x ",HottKeyboard);
876
                        HottKeyboard = 0;
894
                        HottKeyboard = 0;
877
                        break;
895
                        break;
878
   default:  line = 0;
896
   default:  line = 0;
879
                        break;
897
                        break;
880
  }
898
  }
881
  break;
899
  break;
882
  case 2:
900
  case 2:
883
  switch(line++)
901
  switch(line++)
884
  {
902
  {
885
        case 0:  
903
        case 0:  
886
                        HoTT_printfxy_INV(0,0,"Setting:%u %s ",ActiveParamSet,EE_Parameter.Name);
904
                        HoTT_printfxy_INV(0,0,"Setting:%u %s ",ActiveParamSet,EE_Parameter.Name);
887
                        break;
905
                        break;
888
    case 1: HoTT_printfxy(0,1,"Min:%2i.%1iV %s ",BattLowVoltageWarning/10, BattLowVoltageWarning%10, Mixer.Name);
906
    case 1: HoTT_printfxy(0,1,"Min:%2i.%1iV %s ",BattLowVoltageWarning/10, BattLowVoltageWarning%10, Mixer.Name);
889
                        break;
907
                        break;
890
    case 2:  HoTT_printfxy(0,2,"ALT:");
908
    case 2:  HoTT_printfxy(0,2,"ALT:");
891
                 if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG)
909
                 if(Parameter_GlobalConfig & CFG_HOEHENREGELUNG)
892
                 {
910
                 {
893
                          if(!(EE_Parameter.GlobalConfig & CFG_HOEHEN_SCHALTER)) HoTT_printf("POTI:%3u ", Parameter_HoehenSchalter)
911
                          if(!(EE_Parameter.GlobalConfig & CFG_HOEHEN_SCHALTER)) HoTT_printf("POTI:%3u ", Parameter_HoehenSchalter)
894
                          else
912
                          else
895
                          {
913
                          {
896
                           if(Parameter_HoehenSchalter > 50) HoTT_printf("(ON)  ") else HoTT_printf("(OFF) ");
914
                           if(Parameter_HoehenSchalter > 50) HoTT_printf("(ON)  ") else HoTT_printf("(OFF) ");
897
                           if((Parameter_ExtraConfig & CFG2_HEIGHT_LIMIT)) HoTT_printf("LIMIT", Parameter_HoehenSchalter)
915
                           if((Parameter_ExtraConfig & CFG2_HEIGHT_LIMIT)) HoTT_printf("LIMIT", Parameter_HoehenSchalter)
898
                           else HoTT_printf("VARIO", Parameter_HoehenSchalter);
916
                           else HoTT_printf("VARIO", Parameter_HoehenSchalter);
899
                          }
917
                          }
900
                         }
918
                         }
901
                        else
919
                        else
902
                                HoTT_printf("DISABLED");
920
                                HoTT_printf("DISABLED");
903
                        break;
921
                        break;
904
    case 3: HoTT_printfxy(0,3,"CF:");
922
    case 3: HoTT_printfxy(0,3,"CF:");
905
                        if(!EE_Parameter.CareFreeChannel) HoTT_printf("DISABLED")
923
                        if(!EE_Parameter.CareFreeChannel) HoTT_printf("DISABLED")
906
                        else
924
                        else
907
                         {
925
                         {
908
                          if(CareFree)  HoTT_printf(" (ON) ") else HoTT_printf(" (OFF)");
926
                          if(CareFree)  HoTT_printf(" (ON) ") else HoTT_printf(" (OFF)");
909
                          if(EE_Parameter.ExtraConfig & CFG_LEARNABLE_CAREFREE) HoTT_printf(" TEACH");
927
                          if(EE_Parameter.ExtraConfig & CFG_LEARNABLE_CAREFREE) HoTT_printf(" TEACH");
910
                         }
928
                         }
911
                        break;
929
                        break;
912
    case 4: HoTT_printfxy(0,4,"GPS:");
930
    case 4: HoTT_printfxy(0,4,"GPS:");
913
                    if(!(Parameter_GlobalConfig & CFG_GPS_AKTIV)) HoTT_printf("DISABLED")
931
                    if(!(Parameter_GlobalConfig & CFG_GPS_AKTIV)) HoTT_printf("DISABLED")
914
                        else
932
                        else
915
                         {
933
                         {
916
                          if(Parameter_GPS_Switch < 50) HoTT_printf("(FREE)")
934
                          if(Parameter_GPS_Switch < 50) HoTT_printf("(FREE)")
917
                          else
935
                          else
918
                          if(Parameter_GPS_Switch >= 180) HoTT_printf("(HOME)")
936
                          if(Parameter_GPS_Switch >= 180) HoTT_printf("(HOME)")
919
                          else
937
                          else
920
                          if(EE_Parameter.ExtraConfig & CFG_GPS_AID) HoTT_printf("(AID) ")
938
                          if(EE_Parameter.ExtraConfig & CFG_GPS_AID) HoTT_printf("(AID) ")
921
                          else HoTT_printf("(HOLD)")
939
                          else HoTT_printf("(HOLD)")
922
                         }
940
                         }
923
                        if(EE_Parameter.FailSafeTime) HoTT_printfxy(10,4," FS:%usek ",EE_Parameter.FailSafeTime)
941
                        if(EE_Parameter.FailSafeTime) HoTT_printfxy(10,4," FS:%usek ",EE_Parameter.FailSafeTime)
924
 
942
 
925
                        break;
943
                        break;
926
    case 5: HoTT_printfxy(0,5,"HOME ALT:");
944
    case 5: HoTT_printfxy(0,5,"HOME ALT:");
927
                        if(EE_Parameter.ComingHomeAltitude) HoTT_printf("%um",EE_Parameter.ComingHomeAltitude) else HoTT_printf("HOLD ");
945
                        if(EE_Parameter.ComingHomeAltitude) HoTT_printf("%um",EE_Parameter.ComingHomeAltitude) else HoTT_printf("HOLD ");
928
                        break;
946
                        break;
929
        case 6:
947
        case 6:
930
                        if(!show_poti)
948
                        if(!show_poti)
931
                         {
949
                         {
932
              HoTT_printfxy(0,6,"Ni:%4i Ro:%4i C:%3i",ChannelNick,ChannelRoll, Parameter_ServoNickControl);
950
              HoTT_printfxy(0,6,"Ni:%4i Ro:%4i C:%3i",ChannelNick,ChannelRoll, Parameter_ServoNickControl);
933
                      HoTT_printfxy(0,7,"Gs:%4i Ya:%4i ",ChannelGas+127,ChannelYaw);
951
                      HoTT_printfxy(0,7,"Gs:%4i Ya:%4i ",ChannelGas+127,ChannelYaw);
934
                         }
952
                         }
935
                        else
953
                        else
936
                         {
954
                         {
937
              HoTT_printfxy(0,6,"P1:%4i P2:%4i 3:%3i",Poti1,Poti2, Poti3);
955
              HoTT_printfxy(0,6,"P1:%4i P2:%4i 3:%3i",Poti1,Poti2, Poti3);
938
                      HoTT_printfxy(0,7,"P4:%4i P5:%4i 6:%3i",Poti4,Poti5, Poti6);
956
                      HoTT_printfxy(0,7,"P4:%4i P5:%4i 6:%3i",Poti4,Poti5, Poti6);
939
                         }
957
                         }
940
 
958
 
941
                        break;
959
                        break;
942
    case 7: //HoTT_printfxy(0,6,"WARNINGS:");
960
    case 7: //HoTT_printfxy(0,6,"WARNINGS:");
943
                        if(HoTTBlink)
961
                        if(HoTTBlink)
944
                        {
962
                        {
945
                         LIBFC_HoTT_SetPos(6 * 21);
963
                         LIBFC_HoTT_SetPos(6 * 21);
946
//                       if(!(Parameter_GlobalConfig & CFG_ACHSENKOPPLUNG_AKTIV)) HoTT_printf_BLINK("COUPLING OFF! ");
964
//                       if(!(Parameter_GlobalConfig & CFG_ACHSENKOPPLUNG_AKTIV)) HoTT_printf_BLINK("COUPLING OFF! ");
947
                         if(EE_Parameter.BitConfig & (CFG_LOOP_LINKS | CFG_LOOP_RECHTS | CFG_LOOP_UNTEN | CFG_LOOP_OBEN)) HoTT_printf_BLINK("LOOPING! ");
965
                         if(EE_Parameter.BitConfig & (CFG_LOOP_LINKS | CFG_LOOP_RECHTS | CFG_LOOP_UNTEN | CFG_LOOP_OBEN)) HoTT_printf_BLINK("LOOPING! ");
948
                         if(Parameter_GlobalConfig & CFG_HEADING_HOLD) HoTT_printf_BLINK("HH! ");
966
                         if(Parameter_GlobalConfig & CFG_HEADING_HOLD) HoTT_printf_BLINK("HH! ");
949
                         if(!(Parameter_GlobalConfig & CFG_KOMPASS_AKTIV)) HoTT_printf_BLINK("COMPASS OFF! ");
967
                         if(!(Parameter_GlobalConfig & CFG_KOMPASS_AKTIV)) HoTT_printf_BLINK("COMPASS OFF! ");
950
                        }
968
                        }
951
                        break;
969
                        break;
952
    case 8: //ASCIIPacket.WarnBeep = HoTT_Waring();
970
    case 8: //ASCIIPacket.WarnBeep = HoTT_Waring();
953
                        break;
971
                        break;
954
    case 9:
972
    case 9:
955
    case 10:
973
    case 10:
956
    case 11:
974
    case 11:
957
    case 12:
975
    case 12:
958
    case 13:
976
    case 13:
959
    case 14:
977
    case 14:
960
    case 15:
978
    case 15:
961
    case 16:
979
    case 16:
962
                        if(HottKeyboard == HOTT_KEY_SET) { if(show_poti) show_poti = 0; else show_poti = 1;   Hott_ClearLine(6);  Hott_ClearLine(7);}
980
                        if(HottKeyboard == HOTT_KEY_SET) { if(show_poti) show_poti = 0; else show_poti = 1;   Hott_ClearLine(6);  Hott_ClearLine(7);}
963
                        else
981
                        else
964
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;}
982
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;}
965
                        else
983
                        else
966
                        if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;};
984
                        if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;};
967
                        HottKeyboard = 0;
985
                        HottKeyboard = 0;
968
                        break;
986
                        break;
969
   default:  line = 0;
987
   default:  line = 0;
970
                        break;
988
                        break;
971
  }
989
  }
972
  break;
990
  break;
973
  case 3:
991
  case 3:
974
  switch(line++)
992
  switch(line++)
975
  {
993
  {
976
        static unsigned char load_waypoint_tmp2 = 1, changed2;
994
        static unsigned char load_waypoint_tmp2 = 1, changed2;
977
        case 0:  
995
        case 0:  
978
                        HoTT_printfxy(0,0,"Load Waypoints");
996
                        HoTT_printfxy(0,0,"Load Waypoints");
979
                        HoTT_printfxy(0,1,"(Relative Positions)");
997
                        HoTT_printfxy(0,1,"(Relative Positions)");
980
//                      HoTT_printfxy(0,1,"(Absolute)"); 
998
//                      HoTT_printfxy(0,1,"(Absolute)"); 
981
                        break;
999
                        break;
982
    case 1:
1000
    case 1:
983
                        if(NaviData_WaypointNumber)     HoTT_printfxy(0,6,"Active WP:%2d/%d ",NaviData_WaypointIndex,NaviData_WaypointNumber)
1001
                        if(NaviData_WaypointNumber)     HoTT_printfxy(0,6,"Active WP:%2d/%d ",NaviData_WaypointIndex,NaviData_WaypointNumber)
984
                        else HoTT_printfxy(0,6,"No WPs active     ")
1002
                        else HoTT_printfxy(0,6,"No WPs active     ")
985
                        break;
1003
                        break;
986
    case 2:
1004
    case 2:
987
                         HoTT_printfxy(0,7,"%2i.%1iV ",UBat/10, UBat%10)
1005
                         HoTT_printfxy(0,7,"%2i.%1iV ",UBat/10, UBat%10)
988
                         HoTT_printfxy(11,7,"%s",WPL_Name)
1006
                         HoTT_printfxy(11,7,"%s",WPL_Name)
989
    case 3:
1007
    case 3:
990
    case 4:
1008
    case 4:
991
    case 5:
1009
    case 5:
992
                        if(load_waypoint_tmp2)
1010
                        if(load_waypoint_tmp2)
993
                         {
1011
                         {
994
                          if(changed2 && HoTTBlink) HoTT_printfxy(10,3,"   ")
1012
                          if(changed2 && HoTTBlink) HoTT_printfxy(10,3,"   ")
995
                          else HoTT_printfxy(10,3,"%2i   ",load_waypoint_tmp2);
1013
                          else HoTT_printfxy(10,3,"%2i   ",load_waypoint_tmp2);
996
                          HoTT_printfxy(0,3,"Load list:")
1014
                          HoTT_printfxy(0,3,"Load list:")
997
                         }
1015
                         }
998
                        else
1016
                        else
999
                         {
1017
                         {
1000
                          HoTT_printfxy(0,3,"Load list: -- ");
1018
                          HoTT_printfxy(0,3,"Load list: -- ");
1001
                         }
1019
                         }
1002
                         if(NaviData_MaxWpListIndex == 0) HoTT_printfxy(0,4,"No SD-Card   ")
1020
                         if(NaviData_MaxWpListIndex == 0) HoTT_printfxy(0,4,"No SD-Card   ")
1003
                         else
1021
                         else
1004
                         {
1022
                         {
1005
                          if(GPSInfo.SatFix == SATFIX_3D)
1023
                          if(GPSInfo.SatFix == SATFIX_3D)
1006
                           {
1024
                           {
1007
                            if(changed2 && load_waypoint_tmp2) HoTT_printfxy(0,4,"(Set -> Load)")
1025
                            if(changed2 && load_waypoint_tmp2) HoTT_printfxy(0,4,"(Set -> Load)")
1008
                            else HoTT_printfxy(0,4,"             ");
1026
                            else HoTT_printfxy(0,4,"             ");
1009
                                if(HottKeyboard == HOTT_KEY_SET) { if(load_waypoint_tmp2) ToNC_Load_WP_List = load_waypoint_tmp2 | 128; changed2 = 0;}
1027
                                if(HottKeyboard == HOTT_KEY_SET) { if(load_waypoint_tmp2) ToNC_Load_WP_List = load_waypoint_tmp2 | 128; changed2 = 0;}
1010
                           } else HoTT_printfxy(0,4,"!No GPS-Fix! ");
1028
                           } else HoTT_printfxy(0,4,"!No GPS-Fix! ");
1011
                         }
1029
                         }
1012
                        if(HottKeyboard == HOTT_KEY_UP && load_waypoint_tmp2 < NaviData_MaxWpListIndex) { changed2 = 1; load_waypoint_tmp2++;HoTTBlink = 0;}
1030
                        if(HottKeyboard == HOTT_KEY_UP && load_waypoint_tmp2 < NaviData_MaxWpListIndex) { changed2 = 1; load_waypoint_tmp2++;HoTTBlink = 0;}
1013
                        if(HottKeyboard == HOTT_KEY_DOWN && load_waypoint_tmp2 > 1) { changed2 = 1; load_waypoint_tmp2--;HoTTBlink = 0;};
1031
                        if(HottKeyboard == HOTT_KEY_DOWN && load_waypoint_tmp2 > 1) { changed2 = 1; load_waypoint_tmp2--;HoTTBlink = 0;};
1014
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;}
1032
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;}
1015
                        if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;};
1033
                        if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;};
1016
                        HottKeyboard = 0;
1034
                        HottKeyboard = 0;
1017
                        break;
1035
                        break;
1018
   default:  line = 0;
1036
   default:  line = 0;
1019
                        break;
1037
                        break;
1020
  }
1038
  }
1021
  break;
1039
  break;
1022
  case 4:
1040
  case 4:
1023
  switch(line++)
1041
  switch(line++)
1024
  {
1042
  {
1025
        static unsigned char load_waypoint_tmp = 1, changed;
1043
        static unsigned char load_waypoint_tmp = 1, changed;
1026
        case 0:  
1044
        case 0:  
1027
                        HoTT_printfxy(0,0,"Load Waypoints");
1045
                        HoTT_printfxy(0,0,"Load Waypoints");
1028
                        HoTT_printfxy(0,1,"(Fixed Positions)");
1046
                        HoTT_printfxy(0,1,"(Fixed Positions)");
1029
                        break;
1047
                        break;
1030
    case 1:
1048
    case 1:
1031
                        if(NaviData_WaypointNumber)     HoTT_printfxy(0,6,"Active WP:%2d/%d ",NaviData_WaypointIndex,NaviData_WaypointNumber)
1049
                        if(NaviData_WaypointNumber)     HoTT_printfxy(0,6,"Active WP:%2d/%d ",NaviData_WaypointIndex,NaviData_WaypointNumber)
1032
                        else HoTT_printfxy(0,6,"No WPs active    ")
1050
                        else HoTT_printfxy(0,6,"No WPs active    ")
1033
                        break;
1051
                        break;
1034
    case 2:
1052
    case 2:
1035
                         HoTT_printfxy(0,7,"%2i.%1iV ",UBat/10, UBat%10)
1053
                         HoTT_printfxy(0,7,"%2i.%1iV ",UBat/10, UBat%10)
1036
                         HoTT_printfxy(11,7,"%s",WPL_Name)
1054
                         HoTT_printfxy(11,7,"%s",WPL_Name)
1037
    case 3:
1055
    case 3:
1038
    case 4:
1056
    case 4:
1039
    case 5:
1057
    case 5:
1040
                        HoTT_printfxy(0,3,"Load list:")
1058
                        HoTT_printfxy(0,3,"Load list:")
1041
                        if(load_waypoint_tmp)
1059
                        if(load_waypoint_tmp)
1042
                         {
1060
                         {
1043
                          if(changed && HoTTBlink) HoTT_printfxy(10,3,"   ")
1061
                          if(changed && HoTTBlink) HoTT_printfxy(10,3,"   ")
1044
                          else HoTT_printfxy(10,3,"%2d (FIX)",load_waypoint_tmp);
1062
                          else HoTT_printfxy(10,3,"%2d (FIX)",load_waypoint_tmp);
1045
                         }
1063
                         }
1046
                        else
1064
                        else
1047
                         {
1065
                         {
1048
                          HoTT_printfxy(10,3," --")
1066
                          HoTT_printfxy(10,3," --")
1049
                         }
1067
                         }
1050
                       
1068
                       
1051
                         if(NaviData_MaxWpListIndex == 0) HoTT_printfxy(0,4,"No SD-Card   ")
1069
                         if(NaviData_MaxWpListIndex == 0) HoTT_printfxy(0,4,"No SD-Card   ")
1052
                         else
1070
                         else
1053
                         {
1071
                         {
1054
                            if(changed && load_waypoint_tmp) HoTT_printfxy(0,4,"(Set -> Load)")
1072
                            if(changed && load_waypoint_tmp) HoTT_printfxy(0,4,"(Set -> Load)")
1055
                            else HoTT_printfxy(0,4,"             ");
1073
                            else HoTT_printfxy(0,4,"             ");
1056
                         }
1074
                         }
1057
                        if(HottKeyboard == HOTT_KEY_UP && load_waypoint_tmp < NaviData_MaxWpListIndex) { changed = 1; load_waypoint_tmp++; HoTTBlink = 0;}
1075
                        if(HottKeyboard == HOTT_KEY_UP && load_waypoint_tmp < NaviData_MaxWpListIndex) { changed = 1; load_waypoint_tmp++; HoTTBlink = 0;}
1058
                        if(HottKeyboard == HOTT_KEY_DOWN && load_waypoint_tmp > 1) { changed = 1; load_waypoint_tmp--; HoTTBlink = 0;};
1076
                        if(HottKeyboard == HOTT_KEY_DOWN && load_waypoint_tmp > 1) { changed = 1; load_waypoint_tmp--; HoTTBlink = 0;};
1059
                        if(HottKeyboard == HOTT_KEY_SET) { if(load_waypoint_tmp) ToNC_Load_WP_List = load_waypoint_tmp; changed = 0;}
1077
                        if(HottKeyboard == HOTT_KEY_SET) { if(load_waypoint_tmp) ToNC_Load_WP_List = load_waypoint_tmp; changed = 0;}
1060
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;}
1078
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;}
1061
                        if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;};
1079
                        if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;};
1062
                        HottKeyboard = 0;
1080
                        HottKeyboard = 0;
1063
                        break;
1081
                        break;
1064
   default:  line = 0;
1082
   default:  line = 0;
1065
                        break;
1083
                        break;
1066
  }
1084
  }
1067
  break;
1085
  break;
1068
  case 5:
1086
  case 5:
1069
  switch(line++)
1087
  switch(line++)
1070
  {
1088
  {
1071
    static unsigned char wp_tmp, changed;
1089
    static unsigned char wp_tmp, changed;
1072
        case 0:  
1090
        case 0:  
1073
                        HoTT_printfxy(0,0,"Store single Position");
1091
                        HoTT_printfxy(0,0,"Store single Position");
1074
//                      HoTT_printfxy(0,1,"(Fixed Positions)"); 
1092
//                      HoTT_printfxy(0,1,"(Fixed Positions)"); 
1075
                        break;
1093
                        break;
1076
    case 1:
1094
    case 1:
1077
                    HoTT_printfxy(0,2," %2i.%1iV ",UBat/10, UBat%10)
1095
                    HoTT_printfxy(0,2," %2i.%1iV ",UBat/10, UBat%10)
1078
                        HoTT_printfxy(0,3," %2i:%02i ",FlugSekunden/60,FlugSekunden%60);                           
1096
                        HoTT_printfxy(0,3," %2i:%02i ",FlugSekunden/60,FlugSekunden%60);                           
1079
//                      HoTT_printfxy(0,4,"Dist:%3dm",NaviData_TargetDistance)
1097
//                      HoTT_printfxy(0,4,"Dist:%3dm",NaviData_TargetDistance)
1080
                        break;
1098
                        break;
1081
    case 2:
1099
    case 2:
1082
                        HoTT_printfxy(11,2,"ALT:%4im", (int16_t)(HoehenWert/100))              
1100
                        HoTT_printfxy(11,2,"ALT:%4im", (int16_t)(HoehenWert/100))              
1083
                        HoTT_printfxy(11,3,"DIR: %3d%c",CompassCorrected, HoTT_GRAD);
1101
                        HoTT_printfxy(11,3,"DIR: %3d%c",CompassCorrected, HoTT_GRAD);
1084
                        HoTT_printfxy(11,4,"Cam: %3i",Parameter_ServoNickControl);
1102
                        HoTT_printfxy(11,4,"Cam: %3i",Parameter_ServoNickControl);
1085
                        break;
1103
                        break;
1086
    case 3:
1104
    case 3:
1087
    case 4:
1105
    case 4:
1088
    case 5:
1106
    case 5:
1089
                    HoTT_printfxy(0,6,"Store point:")
1107
                    HoTT_printfxy(0,6,"Store point:")
1090
                        if(wp_tmp)
1108
                        if(wp_tmp)
1091
                         {
1109
                         {
1092
                          if(changed && HoTTBlink) HoTT_printfxy(13,6,"   ")
1110
                          if(changed && HoTTBlink) HoTT_printfxy(13,6,"   ")
1093
                          else HoTT_printfxy(13,6,"%2d ",wp_tmp);
1111
                          else HoTT_printfxy(13,6,"%2d ",wp_tmp);
1094
                         }
1112
                         }
1095
                        else
1113
                        else
1096
                         {
1114
                         {
1097
                          HoTT_printfxy(13,6,"--")
1115
                          HoTT_printfxy(13,6,"--")
1098
                         }
1116
                         }
1099
                       
1117
                       
1100
                    if(GPSInfo.SatFix == SATFIX_3D)
1118
                    if(GPSInfo.SatFix == SATFIX_3D)
1101
                    {
1119
                    {
1102
                         if(NaviData_MaxWpListIndex == 0) HoTT_printfxy(0,7,"No SD-Card   ")
1120
                         if(NaviData_MaxWpListIndex == 0) HoTT_printfxy(0,7,"No SD-Card   ")
1103
                         else
1121
                         else
1104
                         {
1122
                         {
1105
                            if(changed && wp_tmp) HoTT_printfxy(0,7,"(Set -> Store)")
1123
                            if(changed && wp_tmp) HoTT_printfxy(0,7,"(Set -> Store)")
1106
                            else Hott_ClearLine(7);
1124
                            else Hott_ClearLine(7);
1107
                         }
1125
                         }
1108
                         if(HottKeyboard == HOTT_KEY_SET) { if(wp_tmp) ToNC_Store_SingePoint = wp_tmp; changed = 0;}
1126
                         if(HottKeyboard == HOTT_KEY_SET) { if(wp_tmp) ToNC_Store_SingePoint = wp_tmp; changed = 0;}
1109
                    }
1127
                    }
1110
            else HoTT_printfxy(0,7,"!No GPS-Fix! ");
1128
            else HoTT_printfxy(0,7,"!No GPS-Fix! ");
1111
                       
1129
                       
1112
                        if(HottKeyboard == HOTT_KEY_UP && wp_tmp < NaviData_MaxWpListIndex) { changed = 1; wp_tmp++; HoTTBlink = 0;}
1130
                        if(HottKeyboard == HOTT_KEY_UP && wp_tmp < NaviData_MaxWpListIndex) { changed = 1; wp_tmp++; HoTTBlink = 0;}
1113
                        if(HottKeyboard == HOTT_KEY_DOWN && wp_tmp > 1) { changed = 1; wp_tmp--; HoTTBlink = 0;};
1131
                        if(HottKeyboard == HOTT_KEY_DOWN && wp_tmp > 1) { changed = 1; wp_tmp--; HoTTBlink = 0;};
1114
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;}
1132
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;}
1115
                        if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;};
1133
                        if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;};
1116
                        HottKeyboard = 0;
1134
                        HottKeyboard = 0;
1117
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1135
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1118
// Bedienung per Taster am Sender
1136
// Bedienung per Taster am Sender
1119
  if(PPM_in[EE_Parameter.MenuKeyChannel] > 50)  // 
1137
  if(PPM_in[EE_Parameter.MenuKeyChannel] > 50)  // 
1120
   {
1138
   {
1121
    hyterese = 2;
1139
    hyterese = 2;
1122
    if(CheckDelay(delay)) { wp_tmp = 0; hyterese = 1;}
1140
    if(CheckDelay(delay)) { wp_tmp = 0; hyterese = 1;}
1123
   }
1141
   }
1124
  else
1142
  else
1125
  if(PPM_in[EE_Parameter.MenuKeyChannel] < -50)  
1143
  if(PPM_in[EE_Parameter.MenuKeyChannel] < -50)  
1126
   {
1144
   {
1127
        delay = SetDelay(2500);
1145
        delay = SetDelay(2500);
1128
        if(hyterese == 2 && (wp_tmp < NaviData_MaxWpListIndex))
1146
        if(hyterese == 2 && (wp_tmp < NaviData_MaxWpListIndex))
1129
         {
1147
         {
1130
          wp_tmp++;
1148
          wp_tmp++;
1131
          ToNC_Store_SingePoint = wp_tmp;
1149
          ToNC_Store_SingePoint = wp_tmp;
1132
          changed = 0;
1150
          changed = 0;
1133
         }
1151
         }
1134
    hyterese = 0;
1152
    hyterese = 0;
1135
   }
1153
   }
1136
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1154
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1137
                        break;
1155
                        break;
1138
   default:  line = 0;
1156
   default:  line = 0;
1139
                        break;
1157
                        break;
1140
  }
1158
  }
1141
  break;
1159
  break;
1142
  case 6:
1160
  case 6:
1143
  switch(line++)
1161
  switch(line++)
1144
  {
1162
  {
1145
    static unsigned char wp_tmp, changed;
1163
    static unsigned char wp_tmp, changed;
1146
        case 0:  
1164
        case 0:  
1147
                        HoTT_printfxy(0,0,"Load single Position");
1165
                        HoTT_printfxy(0,0,"Load single Position");
1148
//                      HoTT_printfxy(0,1,"(Fixed Positions)"); 
1166
//                      HoTT_printfxy(0,1,"(Fixed Positions)"); 
1149
                        break;
1167
                        break;
1150
    case 1:
1168
    case 1:
1151
                    HoTT_printfxy(0,2," %2i.%1iV ",UBat/10, UBat%10)
1169
                    HoTT_printfxy(0,2," %2i.%1iV ",UBat/10, UBat%10)
1152
                        HoTT_printfxy(0,3," %2i:%02i ",FlugSekunden/60,FlugSekunden%60);                           
1170
                        HoTT_printfxy(0,3," %2i:%02i ",FlugSekunden/60,FlugSekunden%60);                           
1153
//                      HoTT_printfxy(0,4,"Dist:%3dm",NaviData_TargetDistance)
1171
//                      HoTT_printfxy(0,4,"Dist:%3dm",NaviData_TargetDistance)
1154
                    if(NaviData_WaypointNumber) HoTT_printfxy(0,5,"WP:%2d/%d Dist:%3dm ",NaviData_WaypointIndex,NaviData_WaypointNumber,NaviData_TargetDistance)
1172
                    if(NaviData_WaypointNumber) HoTT_printfxy(0,5,"WP:%2d/%d Dist:%3dm ",NaviData_WaypointIndex,NaviData_WaypointNumber,NaviData_TargetDistance)
1155
                    else Hott_ClearLine(5);
1173
                    else Hott_ClearLine(5);
1156
                        break;
1174
                        break;
1157
    case 2:
1175
    case 2:
1158
                        if(FromNC_AltitudeSpeed)
1176
                        if(FromNC_AltitudeSpeed)
1159
                          HoTT_printfxy(8,2,"ALT:%4i/%im ", (int16_t)(HoehenWert/100),(int16_t)(FromNC_AltitudeSetpoint/100))
1177
                          HoTT_printfxy(8,2,"ALT:%4i/%im ", (int16_t)(HoehenWert/100),(int16_t)(FromNC_AltitudeSetpoint/100))
1160
                        else
1178
                        else
1161
                          HoTT_printfxy(8,2,"ALT:%4im    ",(int16_t)(HoehenWert/100))
1179
                          HoTT_printfxy(8,2,"ALT:%4im    ",(int16_t)(HoehenWert/100))
1162
 
1180
 
1163
                        HoTT_printfxy(8,3,"DIR: %3d%c",CompassCorrected, HoTT_GRAD);
1181
                        HoTT_printfxy(8,3,"DIR: %3d%c",CompassCorrected, HoTT_GRAD);
1164
                        HoTT_printfxy(8,4,"Cam: %3i",Parameter_ServoNickControl);
1182
                        HoTT_printfxy(8,4,"Cam: %3i",Parameter_ServoNickControl);
1165
                        break;
1183
                        break;
1166
//                       HoTT_printfxy(11,7,"%s",WPL_Name)
1184
//                       HoTT_printfxy(11,7,"%s",WPL_Name)
1167
    case 3:
1185
    case 3:
1168
    case 4:                                      
1186
    case 4:                                      
1169
    case 5:
1187
    case 5:
1170
                  if(HottKeyboard) DebugOut.Analog[17]++;
1188
                  if(HottKeyboard) DebugOut.Analog[17]++;
1171
                  HoTT_printfxy(0,6,"load point:")
1189
                  HoTT_printfxy(0,6,"load point:")
1172
                        if(wp_tmp)
1190
                        if(wp_tmp)
1173
                         {
1191
                         {
1174
                          if(changed && HoTTBlink) HoTT_printfxy(11,6,"   ")
1192
                          if(changed && HoTTBlink) HoTT_printfxy(11,6,"   ")
1175
                          else HoTT_printfxy(11,6,"%2d",wp_tmp);
1193
                          else HoTT_printfxy(11,6,"%2d",wp_tmp);
1176
                         }
1194
                         }
1177
                        else
1195
                        else
1178
                         {
1196
                         {
1179
                          HoTT_printfxy(11,6,"--")
1197
                          HoTT_printfxy(11,6,"--")
1180
                         }
1198
                         }
1181
                       
1199
                       
1182
                         if(NaviData_MaxWpListIndex == 0) HoTT_printfxy(0,7,"No SD-Card   ")
1200
                         if(NaviData_MaxWpListIndex == 0) HoTT_printfxy(0,7,"No SD-Card   ")
1183
                         else
1201
                         else
1184
                         {
1202
                         {
1185
                            if(changed && wp_tmp) HoTT_printfxy(0,7,"(Set -> Load)")
1203
                            if(changed && wp_tmp) HoTT_printfxy(0,7,"(Set -> Load)")
1186
                            else
1204
                            else
1187
                                {
1205
                                {
1188
                                 Hott_ClearLine(7);
1206
                                 Hott_ClearLine(7);
1189
                                 if(NaviData_WaypointNumber) HoTT_printfxy(0,7,"%s",WPL_Name);
1207
                                 if(NaviData_WaypointNumber) HoTT_printfxy(0,7,"%s",WPL_Name);
1190
                                }
1208
                                }
1191
                         }
1209
                         }
1192
                        if(HottKeyboard == HOTT_KEY_UP && wp_tmp < NaviData_MaxWpListIndex) { changed = 1; wp_tmp++; HoTTBlink = 0;}
1210
                        if(HottKeyboard == HOTT_KEY_UP && wp_tmp < NaviData_MaxWpListIndex) { changed = 1; wp_tmp++; HoTTBlink = 0;}
1193
                        if(HottKeyboard == HOTT_KEY_DOWN && wp_tmp > 1) { changed = 1; wp_tmp--; HoTTBlink = 0;};
1211
                        if(HottKeyboard == HOTT_KEY_DOWN && wp_tmp > 1) { changed = 1; wp_tmp--; HoTTBlink = 0;};
1194
                        if(HottKeyboard == HOTT_KEY_SET) { if(wp_tmp) ToNC_Load_SingePoint = wp_tmp; changed = 0;}
1212
                        if(HottKeyboard == HOTT_KEY_SET) { if(wp_tmp) ToNC_Load_SingePoint = wp_tmp; changed = 0;}
1195
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;}
1213
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;}
1196
                        if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;};
1214
                        if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;};
1197
                        HottKeyboard = 0;
1215
                        HottKeyboard = 0;
1198
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1216
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1199
// Bedienung per Taster am Sender
1217
// Bedienung per Taster am Sender
1200
  if(PPM_in[EE_Parameter.MenuKeyChannel] > 50)  // 
1218
  if(PPM_in[EE_Parameter.MenuKeyChannel] > 50)  // 
1201
   {
1219
   {
1202
    hyterese = 2;
1220
    hyterese = 2;
1203
    if(CheckDelay(delay)) { wp_tmp = 0; hyterese = 1;}
1221
    if(CheckDelay(delay)) { wp_tmp = 0; hyterese = 1;}
1204
   }
1222
   }
1205
  else
1223
  else
1206
  if(PPM_in[EE_Parameter.MenuKeyChannel] < -50)  
1224
  if(PPM_in[EE_Parameter.MenuKeyChannel] < -50)  
1207
   {
1225
   {
1208
        delay = SetDelay(2500);
1226
        delay = SetDelay(2500);
1209
        if(hyterese == 2 && (wp_tmp < NaviData_MaxWpListIndex))
1227
        if(hyterese == 2 && (wp_tmp < NaviData_MaxWpListIndex))
1210
         {
1228
         {
1211
          wp_tmp++;
1229
          wp_tmp++;
1212
          ToNC_Load_SingePoint = wp_tmp;
1230
          ToNC_Load_SingePoint = wp_tmp;
1213
          changed = 0;
1231
          changed = 0;
1214
         }
1232
         }
1215
    hyterese = 0;
1233
    hyterese = 0;
1216
   }
1234
   }
1217
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1235
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1218
                        break;
1236
                        break;
1219
   default:  line = 0;
1237
   default:  line = 0;
1220
                        break;
1238
                        break;
1221
  }
1239
  }
1222
  break;
1240
  break;
1223
  case 7:
1241
  case 7:
1224
  switch(line++)
1242
  switch(line++)
1225
  {
1243
  {
1226
        static unsigned char i=0,test=0,set=0;
1244
        static unsigned char i=0,test=0,set=0;
1227
               
1245
               
1228
        case 0: HoTT_printfxy(0,0,"Motortest / Setpoints");break;
1246
        case 0: HoTT_printfxy(0,0,"Motortest / Setpoints");break;
1229
        case 1: //HoTT_printfxy(0,1,"Motor Setpoint Strom ");
1247
        case 1: //HoTT_printfxy(0,1,"Motor Setpoint Strom ");
1230
    case 2:
1248
    case 2:
1231
    case 3:
1249
    case 3:
1232
        case 4: i=((line-2)*2)+1;
1250
        case 4: i=((line-2)*2)+1;
1233
                        if(MotorenEin)
1251
                        if(MotorenEin)
1234
                        {
1252
                        {
1235
                                HoTT_printfxy(0,line,"M%i=%2i%2i.%iA M%i=%2i%2i.%iA",i,Motor[i-1].SetPoint,Motor[i-1].Current/10,Motor[i-1].Current%10,i+1,Motor[i].SetPoint,Motor[i].Current/10,Motor[i].Current%10);
1253
                                HoTT_printfxy(0,line,"M%i=%2i%2i.%iA M%i=%2i%2i.%iA",i,Motor[i-1].SetPoint,Motor[i-1].Current/10,Motor[i-1].Current%10,i+1,Motor[i].SetPoint,Motor[i].Current/10,Motor[i].Current%10);
1236
                        }
1254
                        }
1237
                        else
1255
                        else
1238
                        {
1256
                        {
1239
                                HoTT_printfxy(0,line,"M%i=%2i%2i.%iA M%i=%2i%2i.%iA",i,MotorTest[i-1],Motor[i-1].Current/10,Motor[i-1].Current%10,i+1,MotorTest[i],Motor[i].Current/10,Motor[i].Current%10);
1257
                                HoTT_printfxy(0,line,"M%i=%2i%2i.%iA M%i=%2i%2i.%iA",i,MotorTest[i-1],Motor[i-1].Current/10,Motor[i-1].Current%10,i+1,MotorTest[i],Motor[i].Current/10,Motor[i].Current%10);
1240
                        }
1258
                        }
1241
                        break;
1259
                        break;
1242
    case 5: if(test)
1260
    case 5: if(test)
1243
                        {
1261
                        {
1244
                                HoTT_printfxy(0,6,"!!!Motortest Aktiv!!!");
1262
                                HoTT_printfxy(0,6,"!!!Motortest Aktiv!!!");
1245
                        }
1263
                        }
1246
        case 6: if(test)
1264
        case 6: if(test)
1247
                        {
1265
                        {
1248
                                PC_MotortestActive = 254;
1266
                                PC_MotortestActive = 254;
1249
                                HoTT_printfxy(0,7,"Motor %i",test);
1267
                                HoTT_printfxy(0,7,"Motor %i",test);
1250
                                MotorTest[test-1]=set;
1268
                                MotorTest[test-1]=set;
1251
                        }
1269
                        }
1252
    case 7:
1270
    case 7:
1253
    case 8:
1271
    case 8:
1254
    case 9:
1272
    case 9:
1255
    case 10:
1273
    case 10:
1256
    case 11:
1274
    case 11:
1257
    case 12:
1275
    case 12:
1258
    case 13:
1276
    case 13:
1259
    case 14:
1277
    case 14:
1260
    case 15:
1278
    case 15:
1261
    case 16:
1279
    case 16:
1262
                        if(HottKeyboard == HOTT_KEY_RIGHT)
1280
                        if(HottKeyboard == HOTT_KEY_RIGHT)
1263
                        {
1281
                        {
1264
                                if(test)
1282
                                if(test)
1265
                                {
1283
                                {
1266
                                        set=0;
1284
                                        set=0;
1267
                                        MotorTest[test-1]=set;
1285
                                        MotorTest[test-1]=set;
1268
                                        if(test<8) test++;
1286
                                        if(test<8) test++;
1269
                                }
1287
                                }
1270
                                else
1288
                                else
1271
                                {
1289
                                {
1272
                                        LIBFC_HoTT_Clear();
1290
                                        LIBFC_HoTT_Clear();
1273
                                        page--;
1291
                                        page--;
1274
                                        line=0;
1292
                                        line=0;
1275
                                }
1293
                                }
1276
                        }                              
1294
                        }                              
1277
                        else
1295
                        else
1278
                        if(HottKeyboard == HOTT_KEY_LEFT)
1296
                        if(HottKeyboard == HOTT_KEY_LEFT)
1279
                        {
1297
                        {
1280
                                if(test)
1298
                                if(test)
1281
                                {
1299
                                {
1282
                                        set=0;
1300
                                        set=0;
1283
                                        MotorTest[test-1]=set;
1301
                                        MotorTest[test-1]=set;
1284
                                        if(test>1) test--;
1302
                                        if(test>1) test--;
1285
                                }
1303
                                }
1286
                                else
1304
                                else
1287
                                {
1305
                                {
1288
                                        LIBFC_HoTT_Clear();
1306
                                        LIBFC_HoTT_Clear();
1289
                                        page++;
1307
                                        page++;
1290
                                        line = 0;
1308
                                        line = 0;
1291
                                }
1309
                                }
1292
                        }
1310
                        }
1293
                        else
1311
                        else
1294
                        if((HottKeyboard == HOTT_KEY_UP) && (set <98 ) && test) set+=2;//GESCHW
1312
                        if((HottKeyboard == HOTT_KEY_UP) && (set <98 ) && test) set+=2;//GESCHW
1295
                        else
1313
                        else
1296
                        if((HottKeyboard == HOTT_KEY_DOWN) && (set >0  ) && test) set-=2;
1314
                        if((HottKeyboard == HOTT_KEY_DOWN) && (set >0  ) && test) set-=2;
1297
                        else
1315
                        else
1298
                        if((HottKeyboard == HOTT_KEY_SET) &&  !MotorenEin)
1316
                        if((HottKeyboard == HOTT_KEY_SET) &&  !MotorenEin)
1299
                        {
1317
                        {
1300
                                if(test) test = 0; else test = 1;
1318
                                if(test) test = 0; else test = 1;
1301
                                set=0;
1319
                                set=0;
1302
                                Hott_ClearLine(6);  Hott_ClearLine(7);
1320
                                Hott_ClearLine(6);  Hott_ClearLine(7);
1303
                        }
1321
                        }
1304
                        HottKeyboard = 0;
1322
                        HottKeyboard = 0;
1305
                        break;
1323
                        break;
1306
   default:  line = 0;
1324
   default:  line = 0;
1307
                        break;
1325
                        break;
1308
        //HoTT_printfxy(10 ,line,"I");
1326
        //HoTT_printfxy(10 ,line,"I");
1309
        //line++;
1327
        //line++;
1310
  }
1328
  }
1311
  break;
1329
  break;
1312
  case 8:
1330
  case 8:
1313
  switch(line++)
1331
  switch(line++)
1314
  {
1332
  {
1315
#define MD_OFF 1
1333
#define MD_OFF 1
1316
#define MD_CAL 2
1334
#define MD_CAL 2
1317
#define MD_SAV 3
1335
#define MD_SAV 3
1318
        static unsigned char mode=MD_OFF,cursor=MD_OFF;
1336
        static unsigned char mode=MD_OFF,cursor=MD_OFF;
1319
 
1337
 
1320
        case 0: HoTT_printfxy(0,0,"ACC calibration");break;
1338
        case 0: HoTT_printfxy(0,0,"ACC calibration");break;
1321
        case 1: HoTT_printfxy(0,2,"ACC:   N:%3i R:%3i ",NeutralAccX,NeutralAccY);
1339
        case 1: HoTT_printfxy(0,2,"ACC:   N:%3i R:%3i ",NeutralAccX,NeutralAccY);
1322
        case 2: HoTT_printfxy(0,3,"Stick:   (%i/%i)     ",ChannelNick,ChannelRoll);
1340
        case 2: HoTT_printfxy(0,3,"Stick:   (%i/%i)     ",ChannelNick,ChannelRoll);
1323
        case 3: if(ChannelNick || ChannelRoll)  HoTT_printfxy(7,3,"!!");
1341
        case 3: if(ChannelNick || ChannelRoll)  HoTT_printfxy(7,3,"!!");
1324
                        break;
1342
                        break;
1325
        case 4: HoTT_printfxy(2,4,"Off");break;
1343
        case 4: HoTT_printfxy(2,4,"Off");break;
1326
    case 5: HoTT_printfxy(2,5,"Calibrate");break;
1344
    case 5: HoTT_printfxy(2,5,"Calibrate");break;
1327
        case 6: HoTT_printfxy(2,6,"Save          ");
1345
        case 6: HoTT_printfxy(2,6,"Save          ");
1328
                        if(mode == MD_SAV && cursor == MD_SAV)
1346
                        if(mode == MD_SAV && cursor == MD_SAV)
1329
                         {
1347
                         {
1330
                          HoTT_printfxy(7,6,"(SET)");
1348
                          HoTT_printfxy(7,6,"(SET)");
1331
                         }
1349
                         }
1332
                        else if((mode == MD_CAL) && !((NC_GPS_ModeCharacter == ' ') || (NC_GPS_ModeCharacter == '/') || (NC_GPS_ModeCharacter == '-')))
1350
                        else if((mode == MD_CAL) && !((NC_GPS_ModeCharacter == ' ') || (NC_GPS_ModeCharacter == '/') || (NC_GPS_ModeCharacter == '-')))
1333
                         {
1351
                         {
1334
                                HoTT_printfxy(2,6,"Swich GPS off!");   
1352
                                HoTT_printfxy(2,6,"Swich GPS off!");   
1335
                         }     
1353
                         }     
1336
                        break;
1354
                        break;
1337
    case 7:
1355
    case 7:
1338
    case 8: HoTT_printfxy(0,cursor+3,">");break;
1356
    case 8: HoTT_printfxy(0,cursor+3,">");break;
1339
    case 9: HoTT_printfxy(1,mode+3,"*");break;
1357
    case 9: HoTT_printfxy(1,mode+3,"*");break;
1340
    case 10:
1358
    case 10:
1341
    case 11:
1359
    case 11:
1342
    case 12:
1360
    case 12:
1343
    case 13:
1361
    case 13:
1344
    case 14:
1362
    case 14:
1345
    case 15:
1363
    case 15:
1346
    case 16:
1364
    case 16:
1347
                        if(HottKeyboard == HOTT_KEY_RIGHT)
1365
                        if(HottKeyboard == HOTT_KEY_RIGHT)
1348
                        {
1366
                        {
1349
                                switch(mode)
1367
                                switch(mode)
1350
                                {
1368
                                {
1351
                                        case MD_OFF: LIBFC_HoTT_Clear();
1369
                                        case MD_OFF: LIBFC_HoTT_Clear();
1352
                                                        page--; // leave menu
1370
                                                        page--; // leave menu
1353
                                                        line = 0;
1371
                                                        line = 0;
1354
                                                        break;
1372
                                                        break;
1355
                                        case MD_CAL: NeutralAccY++;
1373
                                        case MD_CAL: NeutralAccY++;
1356
                                                        break;
1374
                                                        break;
1357
                                        case MD_SAV: break;
1375
                                        case MD_SAV: break;
1358
                                        default: mode=MD_OFF;break;
1376
                                        default: mode=MD_OFF;break;
1359
                                }
1377
                                }
1360
                        }
1378
                        }
1361
                        else
1379
                        else
1362
                        if(HottKeyboard == HOTT_KEY_LEFT)
1380
                        if(HottKeyboard == HOTT_KEY_LEFT)
1363
                        {
1381
                        {
1364
                                switch(mode)
1382
                                switch(mode)
1365
                                {
1383
                                {
1366
                                        case MD_OFF: LIBFC_HoTT_Clear();
1384
                                        case MD_OFF: LIBFC_HoTT_Clear();
1367
                                                        page++;  // leave menu
1385
                                                        page++;  // leave menu
1368
                                                        line = 0;
1386
                                                        line = 0;
1369
                                                        break;
1387
                                                        break;
1370
                                        case MD_CAL: NeutralAccY--;
1388
                                        case MD_CAL: NeutralAccY--;
1371
                                                        break;
1389
                                                        break;
1372
                                        case MD_SAV: break;
1390
                                        case MD_SAV: break;
1373
                                        default: mode=MD_OFF;
1391
                                        default: mode=MD_OFF;
1374
                                                        break;
1392
                                                        break;
1375
                                }                              
1393
                                }                              
1376
                        }
1394
                        }
1377
                        else
1395
                        else
1378
                        if(HottKeyboard == HOTT_KEY_UP)
1396
                        if(HottKeyboard == HOTT_KEY_UP)
1379
                        {
1397
                        {
1380
                                switch(mode)
1398
                                switch(mode)
1381
                                {
1399
                                {
1382
                                        case MD_CAL: NeutralAccX++;
1400
                                        case MD_CAL: NeutralAccX++;
1383
                                                        break;
1401
                                                        break;
1384
                                        case MD_OFF:
1402
                                        case MD_OFF:
1385
                                        case MD_SAV: if(cursor>1) {HoTT_printfxy(0,cursor+3," ");cursor--;}
1403
                                        case MD_SAV: if(cursor>1) {HoTT_printfxy(0,cursor+3," ");cursor--;}
1386
                                                        HoTT_printfxy(2,6,"     ");
1404
                                                        HoTT_printfxy(2,6,"     ");
1387
                                                        break;
1405
                                                        break;
1388
                                        default: mode=MD_OFF;
1406
                                        default: mode=MD_OFF;
1389
                                                        break;
1407
                                                        break;
1390
                                }
1408
                                }
1391
                        }
1409
                        }
1392
                        else
1410
                        else
1393
                        if(HottKeyboard == HOTT_KEY_DOWN)
1411
                        if(HottKeyboard == HOTT_KEY_DOWN)
1394
                        {
1412
                        {
1395
                                switch(mode)
1413
                                switch(mode)
1396
                                {
1414
                                {
1397
                                        case MD_CAL:    NeutralAccX--;
1415
                                        case MD_CAL:    NeutralAccX--;
1398
                                                                break;
1416
                                                                break;
1399
                                        case MD_SAV:
1417
                                        case MD_SAV:
1400
                                        case MD_OFF:    if(cursor<MD_SAV) {HoTT_printfxy(0,cursor+3," ");cursor++;}
1418
                                        case MD_OFF:    if(cursor<MD_SAV) {HoTT_printfxy(0,cursor+3," ");cursor++;}
1401
                                                                break;
1419
                                                                break;
1402
                                        default:        mode=MD_OFF;
1420
                                        default:        mode=MD_OFF;
1403
                                                                break;
1421
                                                                break;
1404
                                }
1422
                                }
1405
                        }
1423
                        }
1406
                        else
1424
                        else
1407
                        if(HottKeyboard == HOTT_KEY_SET)
1425
                        if(HottKeyboard == HOTT_KEY_SET)
1408
                        {
1426
                        {
1409
                                switch(mode)
1427
                                switch(mode)
1410
                                {
1428
                                {
1411
                                        case MD_OFF: HoTT_printfxy(1,mode+3," ");
1429
                                        case MD_OFF: HoTT_printfxy(1,mode+3," ");
1412
                                                        mode = cursor;
1430
                                                        mode = cursor;
1413
                                                        if(mode == MD_CAL && !EE_Parameter.Driftkomp) EE_Parameter.Driftkomp = 6; // enables the Gyro-Drift compensation to make sure that a litlte calibration error won't effect the attitude
1431
                                                        if(mode == MD_CAL && !EE_Parameter.Driftkomp) EE_Parameter.Driftkomp = 6; // enables the Gyro-Drift compensation to make sure that a litlte calibration error won't effect the attitude
1414
                                                        break;
1432
                                                        break;
1415
                                        case MD_CAL: HoTT_printfxy(1,mode+3," ");
1433
                                        case MD_CAL: HoTT_printfxy(1,mode+3," ");
1416
                                                        mode = MD_OFF;
1434
                                                        mode = MD_OFF;
1417
                                                        break;
1435
                                                        break;
1418
                                        case MD_SAV:
1436
                                        case MD_SAV:
1419
                                                        Hott_ClearLine(7);
1437
                                                        Hott_ClearLine(7);
1420
                                                        if(cursor == MD_SAV)
1438
                                                        if(cursor == MD_SAV)
1421
                                                        {
1439
                                                        {
1422
                                                                if(!MotorenEin)
1440
                                                                if(!MotorenEin)
1423
                                                                {
1441
                                                                {
1424
/*                                                                      BoatNeutralNick = AdNeutralNick;
1442
/*                                                                      BoatNeutralNick = AdNeutralNick;
1425
                                                                        BoatNeutralRoll = AdNeutralRoll;
1443
                                                                        BoatNeutralRoll = AdNeutralRoll;
1426
                                                                        BoatNeutralGier = AdNeutralGier;
1444
                                                                        BoatNeutralGier = AdNeutralGier;
1427
                                                                        SetParamWord(PID_ACC_NICK, (uint16_t)NeutralAccX);
1445
                                                                        SetParamWord(PID_ACC_NICK, (uint16_t)NeutralAccX);
1428
                                                                        SetParamWord(PID_ACC_ROLL, (uint16_t)NeutralAccY);
1446
                                                                        SetParamWord(PID_ACC_ROLL, (uint16_t)NeutralAccY);
1429
                                                                        SetParamWord(PID_GYRO_NICK,(uint16_t)BoatNeutralNick);
1447
                                                                        SetParamWord(PID_GYRO_NICK,(uint16_t)BoatNeutralNick);
1430
                                                                        SetParamWord(PID_GYRO_ROLL,(uint16_t)BoatNeutralRoll);
1448
                                                                        SetParamWord(PID_GYRO_ROLL,(uint16_t)BoatNeutralRoll);
1431
                                                                        SetParamWord(PID_GYRO_YAW,(uint16_t)BoatNeutralGier);
1449
                                                                        SetParamWord(PID_GYRO_YAW,(uint16_t)BoatNeutralGier);
1432
*/
1450
*/
1433
                                                                        StoreNeutralToEeprom();
1451
                                                                        StoreNeutralToEeprom();
1434
                                                                        HoTT_printfxy(7,6," okay ");
1452
                                                                        HoTT_printfxy(7,6," okay ");
1435
                                                                        HoTT_printfxy(1,mode+3," ");
1453
                                                                        HoTT_printfxy(1,mode+3," ");
1436
                                                                        mode = MD_OFF;
1454
                                                                        mode = MD_OFF;
1437
                                                                }
1455
                                                                }
1438
                                                                else
1456
                                                                else
1439
                                                                {
1457
                                                                {
1440
                                                                        HoTT_printfxy(0,7,"Motors running!!!");
1458
                                                                        HoTT_printfxy(0,7,"Motors running!!!");
1441
                                                                        mode = MD_OFF;
1459
                                                                        mode = MD_OFF;
1442
                                                                }
1460
                                                                }
1443
                                                        }
1461
                                                        }
1444
                                                        else
1462
                                                        else
1445
                                                        {
1463
                                                        {
1446
                                                                HoTT_printfxy(1,mode+3," ");
1464
                                                                HoTT_printfxy(1,mode+3," ");
1447
                                                                mode=cursor;
1465
                                                                mode=cursor;
1448
                                                        }
1466
                                                        }
1449
                                                        break;
1467
                                                        break;
1450
                                        default: mode=MD_OFF;
1468
                                        default: mode=MD_OFF;
1451
                                                        break;
1469
                                                        break;
1452
                                }
1470
                                }
1453
                        }
1471
                        }
1454
                        HottKeyboard = 0;
1472
                        HottKeyboard = 0;
1455
                        break;
1473
                        break;
1456
   default:  line = 0;
1474
   default:  line = 0;
1457
                        break;
1475
                        break;
1458
        //HoTT_printfxy(10 ,line,"I");
1476
        //HoTT_printfxy(10 ,line,"I");
1459
        //line++;
1477
        //line++;
1460
  }
1478
  }
1461
  break;
1479
  break;
1462
/*
1480
/*
1463
//------------------------------------------------------------------------------------------
1481
//------------------------------------------------------------------------------------------
1464
// HoTT-Plus
1482
// HoTT-Plus
1465
//------------------------------------------------------------------------------------------
1483
//------------------------------------------------------------------------------------------
1466
  case 9:
1484
  case 9:
1467
  switch(line++)
1485
  switch(line++)
1468
  {
1486
  {
1469
        case 0: HoTT_printfxy(0,0,"I2C Schwerpunkt GAS");
1487
        case 0: HoTT_printfxy(0,0,"I2C Schwerpunkt GAS");
1470
                        break;
1488
                        break;
1471
        case 1: HoTT_printfxy(0,1,"I2C%3i%3i%3i%3i",Motor[0].State & MOTOR_STATE_ERROR_MASK,Motor[1].State & MOTOR_STATE_ERROR_MASK, Motor[2].State & MOTOR_STATE_ERROR_MASK, Motor[3].State & MOTOR_STATE_ERROR_MASK);
1489
        case 1: HoTT_printfxy(0,1,"I2C%3i%3i%3i%3i",Motor[0].State & MOTOR_STATE_ERROR_MASK,Motor[1].State & MOTOR_STATE_ERROR_MASK, Motor[2].State & MOTOR_STATE_ERROR_MASK, Motor[3].State & MOTOR_STATE_ERROR_MASK);
1472
                        break;
1490
                        break;
1473
    case 2: HoTT_printfxy(0,2,"   %3i%3i%3i%3i",Motor[4].State & MOTOR_STATE_ERROR_MASK,Motor[5].State & MOTOR_STATE_ERROR_MASK, Motor[6].State & MOTOR_STATE_ERROR_MASK, Motor[7].State & MOTOR_STATE_ERROR_MASK);
1491
    case 2: HoTT_printfxy(0,2,"   %3i%3i%3i%3i",Motor[4].State & MOTOR_STATE_ERROR_MASK,Motor[5].State & MOTOR_STATE_ERROR_MASK, Motor[6].State & MOTOR_STATE_ERROR_MASK, Motor[7].State & MOTOR_STATE_ERROR_MASK);
1474
                        break;
1492
                        break;
1475
   
1493
   
1476
        case 3:  {                       //0123456789ABCDEF
1494
        case 3:  {                       //0123456789ABCDEF
1477
                                int r=0;
1495
                                int r=0;
1478
                                int n=0;
1496
                                int n=0;
1479
                                int g=0;
1497
                                int g=0;
1480
                                n=SummeNick >> 9;
1498
                                n=SummeNick >> 9;
1481
                                r=SummeRoll >> 9;
1499
                                r=SummeRoll >> 9;
1482
                                g=Mess_Integral_Gier >> 9;
1500
                                g=Mess_Integral_Gier >> 9;
1483
 
1501
 
1484
                                HoTT_printfxy(0,5,"%3iN   %3iR   %3iG",n ,r ,g);
1502
                                HoTT_printfxy(0,5,"%3iN   %3iR   %3iG",n ,r ,g);
1485
                        }
1503
                        }
1486
 
1504
 
1487
                        break;
1505
                        break;
1488
    case 4: {                       //0123456789ABCDEF
1506
    case 4: {                       //0123456789ABCDEF
1489
                                HoTT_printfxy(0,4,"+  ^   +  <");
1507
                                HoTT_printfxy(0,4,"+  ^   +  <");
1490
                        }
1508
                        }
1491
                        break;
1509
                        break;
1492
    case 5: {                       //0123456789ABCDEF
1510
    case 5: {                       //0123456789ABCDEF
1493
                                HoTT_printfxy(0,6,"-  v   -  >");
1511
                                HoTT_printfxy(0,6,"-  v   -  >");
1494
                        }
1512
                        }
1495
                        break;
1513
                        break;
1496
        case 6: HoTT_printfxy(0,7,"%3i=HG/4 %3i=Gas",HoverGas/4,StickGas);
1514
        case 6: HoTT_printfxy(0,7,"%3i=HG/4 %3i=Gas",HoverGas/4,StickGas);
1497
 
1515
 
1498
                        break;
1516
                        break;
1499
    case 7:
1517
    case 7:
1500
    case 8:
1518
    case 8:
1501
    case 9:
1519
    case 9:
1502
    case 10:
1520
    case 10:
1503
    case 11:
1521
    case 11:
1504
    case 12:
1522
    case 12:
1505
    case 13:
1523
    case 13:
1506
    case 14:
1524
    case 14:
1507
    case 15:
1525
    case 15:
1508
    case 16:
1526
    case 16:
1509
                        if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;}
1527
                        if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;}
1510
                        else
1528
                        else
1511
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;}
1529
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;}
1512
                        HottKeyboard = 0;
1530
                        HottKeyboard = 0;
1513
                        break;
1531
                        break;
1514
   default:  line = 0;
1532
   default:  line = 0;
1515
                        break;
1533
                        break;
1516
  }
1534
  }
1517
  break;
1535
  break;
1518
//---------------------------------------------------------------------------------------------------
1536
//---------------------------------------------------------------------------------------------------
1519
  case 10:
1537
  case 10:
1520
{  
1538
{  
1521
        static signed char i=0,j=0,Changepos=0;                  
1539
        static signed char i=0,j=0,Changepos=0;                  
1522
       
1540
       
1523
        if(line==9)
1541
        if(line==9)
1524
        {
1542
        {
1525
                line=0;
1543
                line=0;
1526
                if(HottKeyboard == HOTT_KEY_SET   ) { if(Changepos) Changepos = 0; else Changepos = 1;}
1544
                if(HottKeyboard == HOTT_KEY_SET   ) { if(Changepos) Changepos = 0; else Changepos = 1;}
1527
                else
1545
                else
1528
                if(Changepos)
1546
                if(Changepos)
1529
                {
1547
                {
1530
                        unsigned char temp=0;
1548
                        unsigned char temp=0;
1531
                        temp=(Changepos+j)-1;
1549
                        temp=(Changepos+j)-1;
1532
                        if((HottKeyboard == HOTT_KEY_RIGHT) && !((unsigned char)(*Parameter_List[temp].Variable + Parameter_List[temp].offset) >= Parameter_List[temp].max )) {*Parameter_List[temp].Variable += 1;}
1550
                        if((HottKeyboard == HOTT_KEY_RIGHT) && !((unsigned char)(*Parameter_List[temp].Variable + Parameter_List[temp].offset) >= Parameter_List[temp].max )) {*Parameter_List[temp].Variable += 1;}
1533
                        else
1551
                        else
1534
                        if((HottKeyboard == HOTT_KEY_LEFT) && !((unsigned char)(*Parameter_List[temp].Variable + Parameter_List[temp].offset) <= Parameter_List[temp].min )) {*Parameter_List[temp].Variable -= 1;}
1552
                        if((HottKeyboard == HOTT_KEY_LEFT) && !((unsigned char)(*Parameter_List[temp].Variable + Parameter_List[temp].offset) <= Parameter_List[temp].min )) {*Parameter_List[temp].Variable -= 1;}
1535
                        else
1553
                        else
1536
                        if(HottKeyboard == HOTT_KEY_UP  )
1554
                        if(HottKeyboard == HOTT_KEY_UP  )
1537
                        {
1555
                        {
1538
                                Changepos--;
1556
                                Changepos--;
1539
                                line = Changepos/2;
1557
                                line = Changepos/2;
1540
                                if(Changepos< 1       ) {Changepos=16;}
1558
                                if(Changepos< 1       ) {Changepos=16;}
1541
                        }
1559
                        }
1542
                        else
1560
                        else
1543
                        if(HottKeyboard == HOTT_KEY_DOWN)
1561
                        if(HottKeyboard == HOTT_KEY_DOWN)
1544
                        {
1562
                        {
1545
                                Changepos++;
1563
                                Changepos++;
1546
                                line = Changepos/2;
1564
                                line = Changepos/2;
1547
                                if(Changepos >= 17       ) {Changepos=1;}
1565
                                if(Changepos >= 17       ) {Changepos=1;}
1548
                        }
1566
                        }
1549
                }
1567
                }
1550
                else
1568
                else
1551
                {
1569
                {
1552
                        if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;}
1570
                        if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;}
1553
                        else
1571
                        else
1554
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;}
1572
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;}
1555
                        else
1573
                        else
1556
                        if(HottKeyboard == HOTT_KEY_UP  )
1574
                        if(HottKeyboard == HOTT_KEY_UP  )
1557
                        {
1575
                        {
1558
                                j-=16;
1576
                                j-=16;
1559
                                line = 0;
1577
                                line = 0;
1560
                                if(j< 0       ) {j=0;}
1578
                                if(j< 0       ) {j=0;}
1561
                        }
1579
                        }
1562
                        else
1580
                        else
1563
                        if(HottKeyboard == HOTT_KEY_DOWN)
1581
                        if(HottKeyboard == HOTT_KEY_DOWN)
1564
                        {
1582
                        {
1565
                                LIBFC_HoTT_Clear();
1583
                                LIBFC_HoTT_Clear();
1566
                                j+=16;
1584
                                j+=16;
1567
                                line = 0;
1585
                                line = 0;
1568
                                if(j+14> MAXPARAM       ) {j=MAXPARAM-15;}
1586
                                if(j+14> MAXPARAM       ) {j=MAXPARAM-15;}
1569
                        }
1587
                        }
1570
                }
1588
                }
1571
               
1589
               
1572
                Debug("line=%i Changepos=%i j=%i Key=%i",line,Changepos,j,HottKeyboard);
1590
                Debug("line=%i Changepos=%i j=%i Key=%i",line,Changepos,j,HottKeyboard);
1573
                HottKeyboard = 0;
1591
                HottKeyboard = 0;
1574
        }
1592
        }
1575
       
1593
       
1576
        HoTT_printfxy(10 ,line,"I");
1594
        HoTT_printfxy(10 ,line,"I");
1577
        i=(line*2)+(j);
1595
        i=(line*2)+(j);
1578
        if(Changepos==(line*2)+1)
1596
        if(Changepos==(line*2)+1)
1579
        {
1597
        {
1580
                HoTT_printfxy(0 ,line,">%3i=%-5.5s%",(unsigned char)(*Parameter_List[i  ].Variable + Parameter_List[i  ].offset),&Parameter_List[i  ].name);
1598
                HoTT_printfxy(0 ,line,">%3i=%-5.5s%",(unsigned char)(*Parameter_List[i  ].Variable + Parameter_List[i  ].offset),&Parameter_List[i  ].name);
1581
        }
1599
        }
1582
        else
1600
        else
1583
        {
1601
        {
1584
                HoTT_printfxy(0 ,line," %3i=%-5.5s%",(unsigned char)(*Parameter_List[i  ].Variable + Parameter_List[i  ].offset),&Parameter_List[i  ].name);
1602
                HoTT_printfxy(0 ,line," %3i=%-5.5s%",(unsigned char)(*Parameter_List[i  ].Variable + Parameter_List[i  ].offset),&Parameter_List[i  ].name);
1585
        }
1603
        }
1586
        if(Changepos==(line*2)+2)
1604
        if(Changepos==(line*2)+2)
1587
        {
1605
        {
1588
                HoTT_printfxy(11,line,">%3i=%-5.5s%",(unsigned char)(*Parameter_List[i+1].Variable + Parameter_List[i+1].offset),&Parameter_List[i+1].name);
1606
                HoTT_printfxy(11,line,">%3i=%-5.5s%",(unsigned char)(*Parameter_List[i+1].Variable + Parameter_List[i+1].offset),&Parameter_List[i+1].name);
1589
        }
1607
        }
1590
        else
1608
        else
1591
        {
1609
        {
1592
                HoTT_printfxy(11,line," %3i=%-5.5s%",(unsigned char)(*Parameter_List[i+1].Variable + Parameter_List[i+1].offset),&Parameter_List[i+1].name);
1610
                HoTT_printfxy(11,line," %3i=%-5.5s%",(unsigned char)(*Parameter_List[i+1].Variable + Parameter_List[i+1].offset),&Parameter_List[i+1].name);
1593
        }
1611
        }
1594
 
1612
 
1595
        line++;
1613
        line++;
1596
       
1614
       
1597
}
1615
}
1598
  break;
1616
  break;
1599
  case 11:
1617
  case 11:
1600
  switch(line++)
1618
  switch(line++)
1601
  {
1619
  {
1602
        case 0: HoTT_printfxy(0,0,"Setting speichern");
1620
        case 0: HoTT_printfxy(0,0,"Setting speichern");
1603
                        break;
1621
                        break;
1604
        case 1: HoTT_printfxy(0,1,"Setting%1i= %-11.11s",GetActiveParamSet(),EE_Parameter.Name);
1622
        case 1: HoTT_printfxy(0,1,"Setting%1i= %-11.11s",GetActiveParamSet(),EE_Parameter.Name);
1605
                        break;                    //123456789012345678901
1623
                        break;                    //123456789012345678901
1606
    case 2: HoTT_printfxy(0,2,"Speichern nach Set %i",settingdest);
1624
    case 2: HoTT_printfxy(0,2,"Speichern nach Set %i",settingdest);
1607
                        break;
1625
                        break;
1608
    case 3: HoTT_printfxy(0,4,"\"SET\" zum speichern");
1626
    case 3: HoTT_printfxy(0,4,"\"SET\" zum speichern");
1609
                        break;
1627
                        break;
1610
    case 4: HoTT_printfxy(0,5,"^ v zum auswaehlen");
1628
    case 4: HoTT_printfxy(0,5,"^ v zum auswaehlen");
1611
                        break;
1629
                        break;
1612
    case 5:  
1630
    case 5:  
1613
        case 6:  
1631
        case 6:  
1614
    case 7:
1632
    case 7:
1615
    case 8:
1633
    case 8:
1616
    case 9:
1634
    case 9:
1617
    case 10:
1635
    case 10:
1618
    case 11:
1636
    case 11:
1619
    case 12:
1637
    case 12:
1620
    case 13:
1638
    case 13:
1621
    case 14:
1639
    case 14:
1622
    case 15:
1640
    case 15:
1623
    case 16:
1641
    case 16:
1624
                        if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;}
1642
                        if(HottKeyboard == HOTT_KEY_RIGHT) { LIBFC_HoTT_Clear(); page--; line = 0;}
1625
                        else
1643
                        else
1626
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;}
1644
                        if(HottKeyboard == HOTT_KEY_LEFT) { LIBFC_HoTT_Clear(); page++; line = 0;}
1627
                        else
1645
                        else
1628
                        if((HottKeyboard == HOTT_KEY_UP) & (settingdest <5 )) settingdest++;
1646
                        if((HottKeyboard == HOTT_KEY_UP) & (settingdest <5 )) settingdest++;
1629
                        else
1647
                        else
1630
                        if((HottKeyboard == HOTT_KEY_DOWN) & (settingdest >1  )) settingdest--;
1648
                        if((HottKeyboard == HOTT_KEY_DOWN) & (settingdest >1  )) settingdest--;
1631
                        else
1649
                        else
1632
                        if((HottKeyboard == HOTT_KEY_SET) &&  !MotorenEin)
1650
                        if((HottKeyboard == HOTT_KEY_SET) &&  !MotorenEin)
1633
                        {
1651
                        {
1634
                                ParamSet_WriteToEEProm(settingdest);
1652
                                ParamSet_WriteToEEProm(settingdest);
1635
                                //JetiBeep = jetibeepcode[GetActiveParamSet()-1];
1653
                                //JetiBeep = jetibeepcode[GetActiveParamSet()-1];
1636
                                Piep(GetActiveParamSet(),120);
1654
                                Piep(GetActiveParamSet(),120);
1637
                                HoTT_printfxy(0,7,"Gespeichert!");  
1655
                                HoTT_printfxy(0,7,"Gespeichert!");  
1638
                        }
1656
                        }
1639
                        HottKeyboard = 0;
1657
                        HottKeyboard = 0;
1640
                        break;
1658
                        break;
1641
   default:  line = 0;
1659
   default:  line = 0;
1642
                        break;
1660
                        break;
1643
  }
1661
  }
1644
  break;
1662
  break;
1645
//------------------------------------------------------------------------------------------
1663
//------------------------------------------------------------------------------------------
1646
 // HoTT-Plus
1664
 // HoTT-Plus
1647
//------------------------------------------------------------------------------------------
1665
//------------------------------------------------------------------------------------------
1648
*/
1666
*/
1649
  default:  page = 0;
1667
  default:  page = 0;
1650
  break;
1668
  break;
1651
 }
1669
 }
1652
}
1670
}
1653
 
1671
 
1654
#endif
1672
#endif
1655
 
1673
 
1656
 
1674
 
1657
       
1675
       
1658
 
1676