Rev 1512 | Rev 1520 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1512 | Rev 1517 | ||
---|---|---|---|
Line 16... | Line 16... | ||
16 | #define JetiBox_printf(format, args...) { _printf_P(&LIBFC_JetiBox_Putchar, PSTR(format) , ## args);} |
16 | #define JetiBox_printf(format, args...) { _printf_P(&LIBFC_JetiBox_Putchar, PSTR(format) , ## args);} |
Line 17... | Line 17... | ||
17 | 17 | ||
18 | // ----------------------------------------------------------- |
18 | // ----------------------------------------------------------- |
19 | // the menu functions |
19 | // the menu functions |
- | 20 | // ----------------------------------------------------------- |
|
20 | // ----------------------------------------------------------- |
21 | |
- | 22 | void Menu_Status(uint8_t key) |
|
- | 23 | { //0123456789ABCDEF |
|
21 | #define JETI_MENU_FCINFO 0 |
24 | JetiBox_printfxy(0,0,"%2i.%1iV",UBat/10, UBat%10); |
22 | void mfc0(uint8_t key) |
25 | if(NaviDataOkay) |
23 | { |
- | |
24 | JetiBox_printfxy(0,0,"+ Flight-Ctrl + "); |
26 | { |
25 | JetiBox_printfxy(0,1,"HW:%d.%d SW:%d.%d%c",PlatinenVersion/10,PlatinenVersion%10,VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH+'a'); |
27 | JetiBox_printfxy(7,0,"%03dm %03d%c", GPSInfo.HomeDistance/10,GPSInfo.HomeBearing, 0xDF); |
26 | } |
28 | } |
27 | /* |
- | |
28 | #define JETI_MENU_VOLT_RC 1 |
- | |
29 | void mfc1(uint8_t key) |
29 | else |
30 | { |
30 | { |
31 | JetiBox_printfxy(0,0,"Volt RC-Level"); |
- | |
32 | JetiBox_printfxy(0,1,"%2i.%1iV %03i",UBat/10, UBat%10, SenderOkay); |
31 | JetiBox_printfxy(7,0,"Status"); |
33 | } |
- | |
34 | */ |
- | |
35 | #define JETI_MENU_HEIGHT 2 |
32 | } |
36 | void mfc2(uint8_t key) |
- | |
37 | { |
33 | JetiBox_printfxy(0,1,"%4i %2i:%02i",Capacity.UsedCapacity,FlugSekunden/60,FlugSekunden%60); |
38 | if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
34 | if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
39 | { |
35 | { |
40 | JetiBox_printfxy(11,1,"%4im", (int16_t)(HoehenWert/100)); |
36 | JetiBox_printfxy(11,1,"%4im", (int16_t)(HoehenWert/100)); |
41 | } |
- | |
42 | JetiBox_printfxy(0,0,"%2i.%1iV",UBat/10, UBat%10); |
- | |
43 | - | ||
44 | JetiBox_printfxy(0,1,"%4i %2i:%02i",Capacity.UsedCapacity,FlugSekunden/60,FlugSekunden%60); |
- | |
45 | if(NaviDataOkay) |
- | |
46 | { |
- | |
47 | JetiBox_printfxy(7,0,"%03dm %03d%c", GPSInfo.HomeDistance/10,GPSInfo.HomeBearing, 0xDF); |
37 | } |
48 | } |
- | |
49 | else |
- | |
Line 50... | Line -... | ||
50 | JetiBox_printfxy(7,0,"Status"); |
- | |
51 | - | ||
52 | } |
38 | } |
53 | #define JETI_MENU_ATTITUDE 3 |
- | |
- | 39 | ||
54 | void mfc3(uint8_t key) |
40 | void Menu_Attitude(uint8_t key) |
55 | { |
41 | { //0123456789ABCDEF |
56 | JetiBox_printfxy(0,0,"Nick Roll Yaw"); |
42 | JetiBox_printfxy(0,0,"Nick Roll Yaw"); |
57 | JetiBox_printfxy(0,1,"%4i %4i %4i", (int16_t)(IntegralNick/1024), (int16_t)(IntegralRoll/1024), (int16_t)(ErsatzKompass / GIER_GRAD_FAKTOR)); |
- | |
- | 43 | JetiBox_printfxy(0,1,"%4i %4i %4i", (int16_t)(IntegralNick/1024), (int16_t)(IntegralRoll/1024), (int16_t)(ErsatzKompass / GIER_GRAD_FAKTOR)); |
|
58 | } |
44 | } |
59 | #define JETI_MENU_AKKU 4 |
45 | |
60 | void mfc4(uint8_t key) |
46 | void Menu_Battery(uint8_t key) |
61 | { //0123456789ABCDEF |
47 | { //0123456789ABCDEF |
62 | JetiBox_printfxy(0,0," [V] [A] [mAh]"); |
48 | JetiBox_printfxy(0,0," [V] [A] [mAh]"); |
Line 63... | Line -... | ||
63 | JetiBox_printfxy(0,1,"%2i.%1i %2i.%1i %6i",UBat/10, UBat%10, Capacity.ActualCurrent/10, Capacity.ActualCurrent%10, Capacity.UsedCapacity); |
- | |
64 | } |
- | |
65 | 49 | JetiBox_printfxy(0,1,"%2i.%1i %2i.%1i %6i",UBat/10, UBat%10, Capacity.ActualCurrent/10, Capacity.ActualCurrent%10, Capacity.UsedCapacity); |
|
66 | 50 | } |
|
67 | #define JETI_MENU_NCINFO 5 |
- | |
68 | void mnc1(uint8_t key) |
51 | |
69 | { |
52 | void Menu_PosInfo(uint8_t key) |
70 | JetiBox_printfxy(1,0,"+ Navi-Ctrl +"); |
- | |
71 | if(NaviDataOkay) |
- | |
72 | { |
- | |
73 | JetiBox_printfxy(0,1,"HW:%d.%d SW:%d.%d%c",NC_Version.Hardware/10,NC_Version.Hardware%10,NC_Version.Major, NC_Version.Minor, NC_Version.Patch+'a'); |
- | |
74 | } |
- | |
75 | else |
- | |
76 | { |
- | |
77 | JetiBox_printfxy(0,1," Not found! "); |
- | |
78 | } |
- | |
79 | } |
- | |
80 | #define JETI_MENU_GPSINFO 6 |
53 | { |
81 | void mnc2(uint8_t key) |
54 | if(NaviDataOkay) |
82 | { |
55 | { |
83 | JetiBox_printfxy(0,0,"Sat:%02d", GPSInfo.NumOfSats); |
56 | JetiBox_printfxy(0,0,"Sat:%02d", GPSInfo.NumOfSats); |
84 | switch (GPSInfo.SatFix) |
57 | switch (GPSInfo.SatFix) |
Line 100... | Line 73... | ||
100 | { |
73 | { |
101 | JetiBox_printfxy(11,0,"/DGPS"); |
74 | JetiBox_printfxy(11,0,"/DGPS"); |
102 | } |
75 | } |
103 | JetiBox_printfxy(0,1,"Home:%03dm %03d%c", GPSInfo.HomeDistance/10, GPSInfo.HomeBearing, 0xDF); |
76 | JetiBox_printfxy(0,1,"Home:%03dm %03d%c", GPSInfo.HomeDistance/10, GPSInfo.HomeBearing, 0xDF); |
104 | } |
77 | } |
- | 78 | else |
|
- | 79 | { //0123456789ABCDEF |
|
- | 80 | JetiBox_printfxy(2,0,"No NaviCtrl!"); |
|
- | 81 | } |
|
- | 82 | } |
|
- | 83 | ||
Line 105... | Line 84... | ||
105 | 84 | ||
106 | // ----------------------------------------------------------- |
85 | // ----------------------------------------------------------- |
107 | // the menu topology |
86 | // the menu topology |
108 | // ----------------------------------------------------------- |
87 | // ----------------------------------------------------------- |
Line 116... | Line 95... | ||
116 | pFctMenu pHandler; |
95 | pFctMenu pHandler; |
117 | } MENU_ENTRY; |
96 | } MENU_ENTRY; |
Line 118... | Line 97... | ||
118 | 97 | ||
119 | - | ||
120 | // the menu navigation structure |
- | |
121 | /* |
98 | |
- | 99 | // the menu navigation structure |
|
122 | 0 ----------------------------- 5 |
100 | /* | |
Line 123... | Line 101... | ||
123 | | | |
101 | |
Line 124... | Line 102... | ||
124 | 4 - 1 - 2 - 3 - 4 - 1 6 |
102 | 3 - 0 - 1 - 2 - 3 - 0 |
125 | 103 | ||
126 | */ |
104 | */ |
127 | 105 | ||
128 | const MENU_ENTRY JetiBox_Menu[] PROGMEM= |
106 | const MENU_ENTRY JetiBox_Menu[] PROGMEM= |
129 | { // l r u d pHandler |
107 | { // l r u d pHandler |
130 | {0, 4, 0, 1, &mfc0 }, // 0 |
- | |
131 | {0, 3, 0, 1, &mfc2 }, // 1 |
- | |
132 | {1, 3, 0, 2, &mfc3 }, // 2 |
108 | {3, 1, 0, 0, &Menu_Status }, // 0 |
Line 133... | Line -... | ||
133 | {2, 0, 0, 3, &mfc4 }, // 3 |
- | |
134 | {0, 4, 4, 5, &mnc1 }, // 4 |
109 | {0, 2, 1, 1, &Menu_Attitude }, // 1 |
135 | {5, 5, 4, 6, &mnc2 } // 5 |
110 | {1, 3, 2, 2, &Menu_Battery }, // 2 |
136 | }; |
111 | {2, 0, 3, 3, &Menu_PosInfo }, // 3 |
137 | 112 | }; |
|
138 | 113 |