Subversion Repositories FlightCtrl

Rev

Rev 2678 | Rev 2692 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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