Rev 1749 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1749 | Rev 1756 | ||
---|---|---|---|
Line 67... | Line 67... | ||
67 | 67 | ||
Line 68... | Line 68... | ||
68 | } |
68 | } |
69 | 69 | ||
- | 70 | void Menu_Battery(uint8_t key) |
|
- | 71 | { //0123456789ABCDEF |
|
- | 72 | ||
- | 73 | if(Capacity.ActualCurrent > MotorsTmax) MotorsTmax = Capacity.ActualCurrent; /// |
|
- | 74 | ||
- | 75 | JetiBox_printfxy(0,0,"%2i.%1iV", UBat/10, UBat%10); |
|
- | 76 | //0123456789ABCDEF |
|
- | 77 | if(!MotorenEin) |
|
- | 78 | { |
|
- | 79 | JetiBox_printfxy(10,0,"%3i.%1iA",MotorsTmax/10, MotorsTmax%10); |
|
- | 80 | } |
|
70 | void Menu_Battery(uint8_t key) |
81 | else |
71 | { //0123456789ABCDEF |
82 | { |
72 | JetiBox_printfxy(0,0,"%2i.%1iV %3i.%1iA", UBat/10, UBat%10, Capacity.ActualCurrent/10, Capacity.ActualCurrent%10); |
83 | JetiBox_printfxy(10,0,"%3i.%1iA",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10); |
73 | //1 |
84 | } |
74 | JetiBox_printfxy(0,1,"%4iW %6imAH",Capacity.ActualPower, Capacity.UsedCapacity); |
85 | JetiBox_printfxy(0,1,"%4iW %6imAH",Capacity.ActualPower, Capacity.UsedCapacity); |
Line 75... | Line 86... | ||
75 | //1 |
86 | |
76 | } |
87 | } |
Line 106... | Line 117... | ||
106 | } |
117 | } |
Line 107... | Line 118... | ||
107 | 118 | ||
108 | 119 | ||
109 | void Menu_Current(uint8_t key) |
- | |
110 | { //0123456789ABCDEF |
120 | void Menu_Current(uint8_t key) |
Line 111... | Line 121... | ||
111 | 121 | { //0123456789ABCDEF |
|
112 | loop1 ++; |
122 | loop1 ++; |
113 | 123 | ||
Line 121... | Line 131... | ||
121 | Motors4 =Motor[4].Current; |
131 | Motors4 =Motor[4].Current; |
122 | Motors5 =Motor[5].Current; |
132 | Motors5 =Motor[5].Current; |
123 | Motors6 =Motor[6].Current; |
133 | Motors6 =Motor[6].Current; |
124 | Motors7 =Motor[7].Current; |
134 | Motors7 =Motor[7].Current; |
125 | } |
135 | } |
- | 136 | ||
- | 137 | if(Motor[0].Current > Motors0max) Motors0max = Motor[0].Current; |
|
126 | JetiBox_printfxy(0,0,"%3i %3i %3i %3i", Motors0-12, Motors1-12, Motors2-12, Motors3-12); |
138 | if(Motor[1].Current > Motors1max) Motors1max = Motor[1].Current; |
127 | JetiBox_printfxy(0,1,"%3i %3i %3i %3i", Motors4-12, Motors5-12, Motors6-12, Motors6-12); |
139 | if(Motor[2].Current > Motors2max) Motors2max = Motor[2].Current; |
- | 140 | if(Motor[3].Current > Motors3max) Motors3max = Motor[3].Current; |
|
- | 141 | if(Motor[4].Current > Motors4max) Motors4max = Motor[4].Current; |
|
- | 142 | if(Motor[5].Current > Motors5max) Motors5max = Motor[5].Current; |
|
- | 143 | if(Motor[6].Current > Motors6max) Motors6max = Motor[6].Current; |
|
- | 144 | if(Motor[7].Current > Motors7max) Motors7max = Motor[7].Current; |
|
- | 145 | ||
- | 146 | if(!MotorenEin) |
|
- | 147 | { |
|
- | 148 | Motors0=Motors0max;Motors1=Motors1max;Motors2=Motors2max;Motors3=Motors3max;Motors4=Motors4max;Motors5=Motors5max;Motors6=Motors6max;Motors7=Motors7max; |
|
- | 149 | } |
|
- | 150 | ||
- | 151 | JetiBox_printfxy(0,0,"%3i %3i %3i %3i", Motors0-(CurrentOffset/RequiredMotors), Motors1-(CurrentOffset/RequiredMotors), Motors2-(CurrentOffset/RequiredMotors), Motors3-(CurrentOffset/RequiredMotors)); |
|
- | 152 | JetiBox_printfxy(0,1,"%3i %3i %3i %3i", Motors4-(CurrentOffset/RequiredMotors), Motors5-(CurrentOffset/RequiredMotors), Motors6-(CurrentOffset/RequiredMotors), Motors6-(CurrentOffset/RequiredMotors)); |
|
- | 153 | ||
128 | if(RequiredMotors <= 4) |
154 | if(RequiredMotors <= 4) |
129 | { |
155 | { |
130 | JetiBox_printfxy(0,1,"Currents "); |
156 | JetiBox_printfxy(0,1,"Currents T%3i.%1iA",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10); |
131 | } |
157 | } |
- | 158 | ||
132 | else |
159 | else |
133 | if(RequiredMotors <= 6) |
160 | if(RequiredMotors <= 6) |
134 | { |
161 | { |
135 | JetiBox_printfxy(8,1,"%3i.%1iA ",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10); |
162 | JetiBox_printfxy(8,1,"%3i.%1iA ",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10); |
136 | } |
163 | } |
Line 222... | Line 249... | ||
222 | } |
249 | } |
Line 223... | Line 250... | ||
223 | 250 | ||
224 | void Menu_Info(uint8_t key) |
251 | void Menu_Info(uint8_t key) |
Line 225... | Line 252... | ||
225 | { //0123456789ABCDEF |
252 | { //0123456789ABCDEF |
226 | 253 | ||
227 | // JetiBox_printfxy(0,0,"%3i=Hovergas",HoverGas); |
254 | JetiBox_printfxy(0,0,"%3i=VSpeed",VarioMeter); |
228 | JetiBox_printfxy(0,1,"%3i=HG/4 %3i=Gas",HoverGas/4,StickGas); |
- | |
229 | } |
- | |
230 | /* |
- | |
Line 231... | Line -... | ||
231 | void Menu_spoti1(uint8_t key) |
- | |
232 | { //0123456789ABCDEF |
- | |
233 | - | ||
234 | JetiBox_printfxy(0,0,">%3i=SPot1",PPM_in[13]); |
- | |
235 | JetiBox_printfxy(0,1," %3i=SPot2",PPM_in[14]); |
- | |
Line 236... | Line -... | ||
236 | if(key== JETIBOX_KEY_UP) PPM_in[13] = PPM_in[13]+1; |
- | |
237 | if(key== JETIBOX_KEY_DOWN) PPM_in[13] = PPM_in[13]-1; |
- | |
Line 238... | Line -... | ||
238 | } |
- | |
239 | - | ||
240 | void Menu_spoti2(uint8_t key) |
- | |
241 | { //0123456789ABCDEF |
- | |
242 | - | ||
Line 243... | Line 255... | ||
243 | JetiBox_printfxy(0,0," %3i=SPot1",PPM_in[13]); |
255 | JetiBox_printfxy(0,1,"%3i=HG/4 %3i=Gas",HoverGas/4,StickGas); |
244 | JetiBox_printfxy(0,1,">%3i=SPot2",PPM_in[14],key); |
256 | } |
245 | if(key== JETIBOX_KEY_UP) PPM_in[14] = PPM_in[14]+5; |
257 | |
246 | if(key== JETIBOX_KEY_DOWN) PPM_in[14] = PPM_in[14]-5; |
258 | |
Line 247... | Line 259... | ||
247 | } |
259 | |
248 | 260 | ||
Line 249... | Line 261... | ||
249 | */ |
261 | |
250 | void Menu_Serialpoti(uint8_t key) |
262 | void Menu_Serialpoti(uint8_t key) |
251 | { |
263 | { |
252 | Menu_keynumber(key); |
264 | Menu_keynumber(key); |
Line 264... | Line 276... | ||
264 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==4)) PPM_in[16] --; |
276 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==4)) PPM_in[16] --; |
265 | } |
277 | } |
Line 266... | Line 278... | ||
266 | 278 | ||
- | 279 | ||
267 | 280 | void Menu_hoeheconf(uint8_t key) |
|
- | 281 | { |
|
- | 282 | /*/ //0123456789ABCDEF |
|
- | 283 | //CFG2_HEIGHT_LIMIT | CFG2_VARIO_BEEP | CFG_SENSITIVE_RC |
|
- | 284 | ||
- | 285 | SENSITIVE_RC on/off |VARIO_BEEP on/off| sw Height= 1 Vario Height = 0; |
|
- | 286 | bit 2 1 0 |
|
- | 287 | 000 0 rcoff Beepoff h |
|
- | 288 | 001 1 rcoff Beepoff v |
|
- | 289 | 010 2 rcoff Beepon h |
|
- | 290 | 011 3 rcoff Beepon v |
|
- | 291 | 100 4 rcon Beepoff h |
|
- | 292 | 101 5 rcon Beepoff v |
|
- | 293 | 110 6 rcon Beepon h |
|
- | 294 | 111 7 rcon Beepon v |
|
- | 295 | ||
- | 296 | /*/ |
|
- | 297 | ||
- | 298 | //JetiBox_printfxy(0,0,"%3i econf",EE_Parameter.ExtraConfig); |
|
268 | void Menu_hoeheconf(uint8_t key) |
299 | //JetiBox_printfxy(0,1,"%3i=beep %3ideckel",(EE_Parameter.ExtraConfig & CFG2_VARIO_BEEP),(EE_Parameter.ExtraConfig & CFG2_HEIGHT_LIMIT)); |
269 | { //0123456789ABCDEF |
300 | |
270 | if(EE_Parameter.ExtraConfig == 3 || EE_Parameter.ExtraConfig == 1) //EE_Parameter.ExtraConfig == 1 =switched Hightv+ variopiepser |
301 | if((EE_Parameter.ExtraConfig & CFG2_HEIGHT_LIMIT) == 1) //EE_Parameter.ExtraConfig == 1 =switched Hightv+ variopiepser |
271 | { |
302 | { |
- | 303 | JetiBox_printfxy(0,0,"switched Hight v"); |
|
272 | JetiBox_printfxy(0,0,"switched Hight v"); |
304 | } |
273 | } |
305 | |
274 | if(EE_Parameter.ExtraConfig == 2 || EE_Parameter.ExtraConfig == 0) |
306 | if((EE_Parameter.ExtraConfig & CFG2_HEIGHT_LIMIT) == 0) |
275 | { |
307 | { |
276 | JetiBox_printfxy(0,1,"Vario withbeep ^"); |
308 | JetiBox_printfxy(0,1,"Vario withbeep ^"); |
- | 309 | } |
|
277 | } |
310 | |
278 | /*/ |
- | |
279 | vario =0 |
- | |
280 | vario und ton 2 |
- | |
281 | nur hohe = 1 |
311 | if(key== JETIBOX_KEY_UP) EE_Parameter.ExtraConfig |= (1 << 0) ;// set bit 0 |
282 | höhe mit schalter=1 |
312 | |
283 | höhe mit variopiep =3 |
313 | if(key== JETIBOX_KEY_DOWN) |
284 | /*/ |
314 | { |
- | 315 | EE_Parameter.ExtraConfig &= ~(1 << 0) ; //delete bit 0 |
|
285 | if(key== JETIBOX_KEY_UP) EE_Parameter.ExtraConfig = 3; |
316 | EE_Parameter.ExtraConfig |= (1 << 1) ; //set bit 1 +piep |
Line 286... | Line 317... | ||
286 | if(key== JETIBOX_KEY_DOWN) EE_Parameter.ExtraConfig = 2; |
317 | } |
Line 468... | Line 499... | ||
468 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==3) & ( EE_Parameter.Gyro_Stability >0 )) EE_Parameter.Gyro_Stability --; |
499 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==3) & ( EE_Parameter.Gyro_Stability >0 )) EE_Parameter.Gyro_Stability --; |
469 | if((key== JETIBOX_KEY_UP ) & (keynumber ==4)) EE_Parameter.DynamicStability ++; |
500 | if((key== JETIBOX_KEY_UP ) & (keynumber ==4)) EE_Parameter.DynamicStability ++; |
470 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==4)) EE_Parameter.DynamicStability --; |
501 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==4)) EE_Parameter.DynamicStability --; |
471 | } |
502 | } |
Line -... | Line 503... | ||
- | 503 | ||
- | 504 | void Menu_camera(uint8_t key) |
|
- | 505 | { |
|
- | 506 | Menu_keynumber(key); |
|
- | 507 | ||
- | 508 | JetiBox_printfxy(0,0,"%c%3i=NCT%c%3i=RCT",pos1,EE_Parameter.ServoNickControl,pos3,EE_Parameter.ServoRollControl); |
|
- | 509 | JetiBox_printfxy(0,1,"%c%3i=NCP%c%3i=RCP",pos2,EE_Parameter.ServoNickComp,pos4,EE_Parameter.ServoRollComp); |
|
- | 510 | ||
- | 511 | if((key== JETIBOX_KEY_UP ) & (keynumber ==1)) EE_Parameter.ServoNickControl ++; // Wert : 0-247 // Stellung des Servos |
|
- | 512 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==1)) EE_Parameter.ServoNickControl --; |
|
- | 513 | if((key== JETIBOX_KEY_UP ) & (keynumber ==2)) EE_Parameter.ServoNickComp ++; // Wert : 0-247 // Einfluss Gyro/Servo |
|
- | 514 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==2)) EE_Parameter.ServoNickComp --; |
|
- | 515 | if((key== JETIBOX_KEY_UP ) & (keynumber ==3)) EE_Parameter.ServoRollControl ++; // Wert : 0-247 // Stellung des Servos |
|
- | 516 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==3)) EE_Parameter.ServoRollControl --; |
|
- | 517 | if((key== JETIBOX_KEY_UP ) & (keynumber ==4)) EE_Parameter.ServoRollComp ++; // Wert : 0-247 // Einfluss Gyro/Servo |
|
- | 518 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==4)) EE_Parameter.ServoRollComp --; |
|
- | 519 | } |
|
- | 520 | ||
- | 521 | ||
- | 522 | ||
472 | 523 | ||
473 | void Menu_mtest(uint8_t key) |
524 | void Menu_mtest(uint8_t key) |
474 | { //0123456789ABCDEF |
525 | { //0123456789ABCDEF |
Line 475... | Line 526... | ||
475 | //extern void LIBFC_JetiBox_Putchar(char c); |
526 | //extern void LIBFC_JetiBox_Putchar(char c); |
Line 476... | Line 527... | ||
476 | 527 | ||
477 | PC_MotortestActive = 240; |
528 | PC_MotortestActive = 240; |
Line 478... | Line 529... | ||
478 | 529 | ||
479 | JetiBox_printfxy(0,0,"Mtest <+v <+^"); |
530 | JetiBox_printfxy(0,0,"Mtest <+v <+^%3i",Motor[loop3].Current-(CurrentOffset/RequiredMotors)); //13 chars |
Line 480... | Line 531... | ||
480 | JetiBox_printfxy(0,1,"Motor=%3i Sp=%2i",loop3+1, MotorTest[loop3]); |
531 | JetiBox_printfxy(0,1,"Motor=%2i Sp=%2i",loop3+1, MotorTest[loop3]); |
Line 487... | Line 538... | ||
487 | MotorTest[loop3]=loop2; |
538 | MotorTest[loop3]=loop2; |
Line 488... | Line 539... | ||
488 | 539 | ||
Line 489... | Line 540... | ||
489 | } |
540 | } |
490 | - | ||
491 | void Menu_mem(uint8_t key) |
- | |
492 | { //0123456789ABCDEF |
541 | |
493 | unsigned char i =0; |
542 | void Menu_mem(uint8_t key) |
494 | 543 | { |
|
- | 544 | JetiBox_printfxy(0,0,"SETTING=%1i",GetActiveParamSet()); |
|
495 | JetiBox_printfxy(0,0,"SETTING=%1i",GetActiveParamSet()); |
545 | JetiBox_printfxy(0,1, "< + >toSTOREto %1i",settingdest); |
- | 546 | // 00123456789ABCDEF |
|
496 | JetiBox_printfxy(0,1,"< and > to STORE"); |
547 | //if(key== JETIBOX_KEY_DOWN ) |
497 | //if(key== JETIBOX_KEY_DOWN ) |
- | |
498 | if(key== JETIBOX_KEY_LANDR && !MotorenEin) |
548 | |
499 | 549 | if(key== JETIBOX_KEY_LANDR && !MotorenEin) |
|
500 | { |
- | |
501 | ParamSet_WriteToEEProm(GetActiveParamSet()); |
550 | { |
502 | - | ||
503 | //for(i=0; i<5; i++) |
551 | ParamSet_WriteToEEProm(settingdest); |
504 | //{ |
552 | Piep(GetActiveParamSet(),120); |
505 | JetiBox_printfxy(i,0,"OK!"); |
553 | JetiBox_printfxy(13,0,"OK!"); |
506 | //} |
- | |
- | 554 | } |
|
Line -... | Line 555... | ||
- | 555 | ||
- | 556 | if((key== JETIBOX_KEY_UP) & (settingdest <5 )) settingdest++; |
|
- | 557 | ||
507 | 558 | ||
Line 508... | Line 559... | ||
508 | } |
559 | if((key== JETIBOX_KEY_DOWN) & (settingdest >1 )) settingdest--; |
509 | 560 | ||
Line 531... | Line 582... | ||
531 | 582 | ||
Line 532... | Line 583... | ||
532 | */ |
583 | */ |
533 | 584 | ||
534 | const MENU_ENTRY JetiBox_Menu[] PROGMEM= |
585 | const MENU_ENTRY JetiBox_Menu[] PROGMEM= |
535 | { // l r u d pHandler links rechts up down |
586 | { // l r u d pHandler links rechts up down |
536 | {23, 1, 0, 0, &Menu_Status }, // Seite 1 |
587 | {22, 1, 0, 0, &Menu_Status }, // Seite 1 |
537 | { 0, 2, 1, 1, &Menu_Temperature }, // 2 |
588 | { 0, 2, 1, 1, &Menu_Temperature }, // 2 |
538 | { 1, 3, 2, 2, &Menu_Battery }, // 3 |
589 | { 1, 3, 2, 2, &Menu_Battery }, // 3 |
539 | { 2, 4, 3, 3, &Menu_PosInfo }, // 4 |
590 | { 2, 4, 3, 3, &Menu_PosInfo }, // 4 |
Line 549... | Line 600... | ||
549 | {12, 14, 13, 13, &Menu_gyro }, // 14 |
600 | {12, 14, 13, 13, &Menu_gyro }, // 14 |
550 | {13, 15, 14, 14, &Menu_gyroGandStab }, // 15 |
601 | {13, 15, 14, 14, &Menu_gyroGandStab }, // 15 |
551 | {14, 16, 15, 15, &Menu_gps }, // 16 |
602 | {14, 16, 15, 15, &Menu_gps }, // 16 |
552 | {15, 17, 16, 16, &Menu_loopP }, // 17 |
603 | {15, 17, 16, 16, &Menu_loopP }, // 17 |
553 | {16, 18, 17, 17, &Menu_coup }, // 18 |
604 | {16, 18, 17, 17, &Menu_coup }, // 18 |
554 | {17, 19, 18, 18, &Menu_LOOPconf }, // 19 |
605 | {17, 19, 18, 18, &Menu_camera }, // 19 |
555 | {18, 20, 19, 19, &Menu_hoeheconf }, // 20 |
606 | {18, 20, 19, 19, &Menu_LOOPconf }, // 20 |
556 | {19, 21, 20, 20, &Menu_mtest }, // 21 |
607 | {19, 21, 20, 20, &Menu_hoeheconf }, // 21 |
557 | {20, 22, 21, 21, &Menu_mem }, // 22 |
608 | {20, 22, 21, 21, &Menu_mtest }, // 22 |
558 | {21, 0, 22, 22, &Menu_mem }, // 23 |
609 | {21, 0, 22, 22, &Menu_mem }, // 23 |
Line 559... | Line 610... | ||
559 | 610 | ||
Line 560... | Line 611... | ||
560 | }; |
611 | }; |
Line 571... | Line 622... | ||
571 | // navigate within the menu by key action |
622 | // navigate within the menu by key action |
572 | last_item = item; |
623 | last_item = item; |
573 | switch(key) |
624 | switch(key) |
574 | { |
625 | { |
575 | case JETIBOX_KEY_LEFT: |
626 | case JETIBOX_KEY_LEFT: |
576 | if (item == 0) return (1); // switch back to jeti expander menu |
627 | ///if (item == 0) return (1); // switch back to jeti expander menu, so no back possible |
577 | else |
628 | ///else |
578 | { |
629 | ///{ |
579 | if (keynumber <= 0 || keynumber >=5) //keynumber normaly 0, only in the parameter pages keyn=1...4 |
630 | if (keynumber <= 0 || keynumber >=5) //keynumber normaly 0, only in the parameter pages keyn=1...4 |
580 | { |
631 | { |
581 | item = pgm_read_byte(&JetiBox_Menu[item].left); //trigger to left menu item |
632 | item = pgm_read_byte(&JetiBox_Menu[item].left); //trigger to left menu item |
582 | } |
633 | } |
583 | } |
634 | ///} |
Line 584... | Line 635... | ||
584 | 635 | ||
585 | break; |
636 | break; |
586 | case JETIBOX_KEY_RIGHT: |
637 | case JETIBOX_KEY_RIGHT: |
587 | if (keynumber <= 0 || keynumber >=5) |
638 | if (keynumber <= 0 || keynumber >=5) |