Rev 1742 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1742 | Rev 1749 | ||
---|---|---|---|
1 | #include "jetimenu.h" |
1 | #include "jetimenu.h" |
2 | #include "libfc.h" |
2 | #include "libfc.h" |
3 | #include "printf_P.h" |
3 | #include "printf_P.h" |
4 | #include "main.h" |
4 | #include "main.h" |
5 | #include "spi.h" |
5 | #include "spi.h" |
6 | #include "capacity.h" |
6 | #include "capacity.h" |
7 | 7 | ||
8 | #define JETIBOX_KEY_RIGHT 0x1F |
8 | #define JETIBOX_KEY_RIGHT 0x1F // |
9 | #define JETIBOX_KEY_UP 0x2F |
9 | #define JETIBOX_KEY_UP 0x2F // 47 |
10 | #define JETIBOX_KEY_DOWN 0x4F |
10 | #define JETIBOX_KEY_DOWN 0x4F // |
11 | #define JETIBOX_KEY_LEFT 0x8F |
11 | #define JETIBOX_KEY_LEFT 0x8F // |
12 | #define JETIBOX_KEY_NONE 0x0F |
12 | #define JETIBOX_KEY_NONE 0x0F // 15 |
- | 13 | #define JETIBOX_KEY_UNDEF 0x00 // |
|
- | 14 | #define JETIBOX_KEY_LANDR 0x9F // 159 |
|
- | 15 | #define JETIBOX_KEY_DownANDR 0x5F // 95 |
|
- | 16 | #define JETIBOX_KEY_DownANDL 0xCF // 207 |
|
- | 17 | #define JETIBOX_KEY_DownANDUP 0x6F // 111 |
|
- | 18 | #define JETIBOX_KEY_UPANDL 0xAF // 175 |
|
- | 19 | #define JETIBOX_KEY_UPANDR 0x3F // 63 |
|
13 | #define JETIBOX_KEY_UNDEF 0x00 |
20 | |
14 | 21 | ||
15 | #define JetiBox_printfxy(x,y,format, args...) { LIBFC_JetiBox_SetPos(y * 16 + x); _printf_P(&LIBFC_JetiBox_Putchar, PSTR(format) , ## args);} |
22 | #define JetiBox_printfxy(x,y,format, args...) { LIBFC_JetiBox_SetPos(y * 16 + x); _printf_P(&LIBFC_JetiBox_Putchar, PSTR(format) , ## args);} |
16 | #define JetiBox_printf(format, args...) { _printf_P(&LIBFC_JetiBox_Putchar, PSTR(format) , ## args);} |
23 | #define JetiBox_printf(format, args...) { _printf_P(&LIBFC_JetiBox_Putchar, PSTR(format) , ## args);} |
17 | 24 | ||
18 | // ----------------------------------------------------------- |
25 | // ----------------------------------------------------------- |
19 | // the menu functions |
26 | // the menu functions |
20 | // ----------------------------------------------------------- |
27 | // ----------------------------------------------------------- |
- | 28 | ||
21 | 29 | ||
- | 30 | void Menu_Status(uint8_t key) |
|
- | 31 | ||
- | 32 | { |
|
22 | void Menu_Status(uint8_t key) |
33 | |
23 | { //0123456789ABCDEF |
34 | //0123456789ABCDEF |
24 | JetiBox_printfxy(0,0,"%2i.%1iV",UBat/10, UBat%10); |
35 | JetiBox_printfxy(0,0,"%2i.%1iV",UBat/10, UBat%10); |
25 | if(NaviDataOkay) |
36 | if(NaviDataOkay) |
26 | { |
37 | { |
27 | // JetiBox_printfxy(6,0,"%03dm %03d%c", GPSInfo.HomeDistance/10,GPSInfo.HomeBearing, 0xDF); |
38 | // JetiBox_printfxy(6,0,"%03dm %03d%c", GPSInfo.HomeDistance/10,GPSInfo.HomeBearing, 0xDF); |
28 | JetiBox_printfxy(6,0,"%3d%c %03dm",(int)(ErsatzKompass / GIER_GRAD_FAKTOR), 0xDF, GPSInfo.HomeDistance/10); |
39 | JetiBox_printfxy(6,0,"%3d%c %03dm",(int)(ErsatzKompass / GIER_GRAD_FAKTOR), 0xDF, GPSInfo.HomeDistance/10); |
29 | } |
40 | } |
30 | else |
41 | else |
31 | { |
42 | { |
32 | JetiBox_printfxy(6,0,"Status"); |
43 | JetiBox_printfxy(6,0,"Status"); |
33 | } |
44 | } |
34 | if(NC_ErrorCode) JetiBox_printfxy(6,0,"ERROR: %2d",NC_ErrorCode); |
45 | if(NC_ErrorCode) JetiBox_printfxy(6,0,"ERROR: %2d",NC_ErrorCode); |
35 | JetiBox_printfxy(0,1,"%4i %2i:%02i",Capacity.UsedCapacity,FlugSekunden/60,FlugSekunden%60); |
46 | JetiBox_printfxy(0,1,"%4i %2i:%02i",Capacity.UsedCapacity,FlugSekunden/60,FlugSekunden%60); |
36 | if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
47 | if(EE_Parameter.GlobalConfig & CFG_HOEHENREGELUNG) |
37 | { |
48 | { |
38 | JetiBox_printfxy(10,1,"%4im%c", (int16_t)(HoehenWert/100),VarioCharacter); |
49 | JetiBox_printfxy(10,1,"%4im%c", (int16_t)(HoehenWert/100),VarioCharacter); |
39 | } |
50 | } |
40 | } |
51 | } |
41 | 52 | ||
42 | 53 | ||
43 | void Menu_Temperature(uint8_t key) |
54 | void Menu_Temperature(uint8_t key) |
44 | { //0123456789ABCDEF |
55 | { //0123456789ABCDEF |
45 | JetiBox_printfxy(0,0,"%3i %3i %3i %3i", Motor[0].Temperature, Motor[1].Temperature, Motor[2].Temperature, Motor[3].Temperature); |
56 | JetiBox_printfxy(0,0,"%3i %3i %3i %3i", Motor[0].Temperature, Motor[1].Temperature, Motor[2].Temperature, Motor[3].Temperature); |
46 | JetiBox_printfxy(0,1,"%3i %3i %3i %3i", Motor[4].Temperature, Motor[5].Temperature, Motor[6].Temperature, Motor[7].Temperature); |
57 | JetiBox_printfxy(0,1,"%3i %3i %3i %3i", Motor[4].Temperature, Motor[5].Temperature, Motor[6].Temperature, Motor[7].Temperature); |
47 | if(RequiredMotors <= 4) |
58 | if(RequiredMotors <= 4) |
48 | { |
59 | { |
49 | JetiBox_printfxy(0,1,"Temperatures "); |
60 | JetiBox_printfxy(0,1,"Temperatures "); |
50 | } |
61 | } |
51 | else |
62 | else |
52 | if(RequiredMotors <= 6) |
63 | if(RequiredMotors <= 6) |
53 | { |
64 | { |
54 | JetiBox_printfxy(8,1,"\%cC ",0xdf); |
65 | JetiBox_printfxy(8,1,"\%cC ",0xdf); |
55 | } |
66 | } |
56 | 67 | ||
57 | } |
68 | } |
58 | 69 | ||
59 | void Menu_Battery(uint8_t key) |
70 | void Menu_Battery(uint8_t key) |
60 | { //0123456789ABCDEF |
71 | { //0123456789ABCDEF |
61 | JetiBox_printfxy(0,0,"%2i.%1iV %3i.%1iA", UBat/10, UBat%10, Capacity.ActualCurrent/10, Capacity.ActualCurrent%10); |
72 | JetiBox_printfxy(0,0,"%2i.%1iV %3i.%1iA", UBat/10, UBat%10, Capacity.ActualCurrent/10, Capacity.ActualCurrent%10); |
62 | //1 |
73 | //1 |
63 | JetiBox_printfxy(0,1,"%4iW %6imAH",Capacity.ActualPower, Capacity.UsedCapacity); |
74 | JetiBox_printfxy(0,1,"%4iW %6imAH",Capacity.ActualPower, Capacity.UsedCapacity); |
64 | //1 |
75 | //1 |
65 | } |
76 | } |
66 | 77 | ||
67 | 78 | ||
68 | void Menu_PosInfo(uint8_t key) |
79 | void Menu_PosInfo(uint8_t key) |
69 | { |
80 | { |
70 | if(NaviDataOkay) |
81 | if(NaviDataOkay) |
71 | { |
82 | { |
72 | JetiBox_printfxy(0,0,"%2um/s Sat:%d ",GPSInfo.Speed,GPSInfo.NumOfSats); |
83 | JetiBox_printfxy(0,0,"%2um/s Sat:%d ",GPSInfo.Speed,GPSInfo.NumOfSats); |
73 | switch (GPSInfo.SatFix) |
84 | switch (GPSInfo.SatFix) |
74 | { |
85 | { |
75 | case SATFIX_3D: |
86 | case SATFIX_3D: |
76 | JetiBox_printfxy(12,0," 3D"); |
87 | JetiBox_printfxy(12,0," 3D"); |
77 | break; |
88 | break; |
78 | 89 | ||
79 | case SATFIX_2D: |
90 | case SATFIX_2D: |
80 | case SATFIX_NONE: |
91 | case SATFIX_NONE: |
81 | default: |
92 | default: |
82 | JetiBox_printfxy(12,0,"NoFx"); |
93 | JetiBox_printfxy(12,0,"NoFx"); |
83 | break; |
94 | break; |
84 | } |
95 | } |
85 | if(GPSInfo.Flags & FLAG_DIFFSOLN) |
96 | if(GPSInfo.Flags & FLAG_DIFFSOLN) |
86 | { |
97 | { |
87 | JetiBox_printfxy(12,0,"DGPS"); |
98 | JetiBox_printfxy(12,0,"DGPS"); |
88 | } |
99 | } |
89 | JetiBox_printfxy(0,1,"Home:%3dm %3d%c", GPSInfo.HomeDistance/10, GPSInfo.HomeBearing, 0xDF); |
100 | JetiBox_printfxy(0,1,"Home:%3dm %3d%c", GPSInfo.HomeDistance/10, GPSInfo.HomeBearing, 0xDF); |
90 | } |
101 | } |
91 | else |
102 | else |
92 | { //0123456789ABCDEF |
103 | { //0123456789ABCDEF |
93 | JetiBox_printfxy(2,0,"No NaviCtrl!"); |
104 | JetiBox_printfxy(2,0,"No NaviCtrl!"); |
94 | } |
105 | } |
95 | } |
106 | } |
96 | 107 | ||
97 | //1 |
108 | |
98 | void Menu_Current(uint8_t key) |
109 | void Menu_Current(uint8_t key) |
99 | { //0123456789ABCDEF |
110 | { //0123456789ABCDEF |
- | 111 | ||
- | 112 | loop1 ++; |
|
- | 113 | ||
- | 114 | if(loop1 >= updatemotors) |
|
- | 115 | { |
|
- | 116 | loop1=0; |
|
- | 117 | Motors0 =Motor[0].Current; |
|
- | 118 | Motors1 =Motor[1].Current; |
|
- | 119 | Motors2 =Motor[2].Current; |
|
- | 120 | Motors3 =Motor[3].Current; |
|
- | 121 | Motors4 =Motor[4].Current; |
|
- | 122 | Motors5 =Motor[5].Current; |
|
- | 123 | Motors6 =Motor[6].Current; |
|
100 | 124 | Motors7 =Motor[7].Current; |
|
101 | 125 | } |
|
102 | JetiBox_printfxy(0,0,"%3i %3i %3i %3i", Motor[0].Current-12, Motor[1].Current-12, Motor[2].Current-12, Motor[3].Current-12); |
126 | JetiBox_printfxy(0,0,"%3i %3i %3i %3i", Motors0-12, Motors1-12, Motors2-12, Motors3-12); |
103 | JetiBox_printfxy(0,1,"%3i %3i %3i %3i", Motor[4].Current-12, Motor[5].Current-12, Motor[6].Current-12, Motor[7].Current-12); |
127 | JetiBox_printfxy(0,1,"%3i %3i %3i %3i", Motors4-12, Motors5-12, Motors6-12, Motors6-12); |
104 | if(RequiredMotors <= 4) |
128 | if(RequiredMotors <= 4) |
105 | { |
129 | { |
106 | JetiBox_printfxy(0,1,"Currents "); |
130 | JetiBox_printfxy(0,1,"Currents "); |
107 | } |
131 | } |
108 | else |
132 | else |
109 | if(RequiredMotors <= 6) |
133 | if(RequiredMotors <= 6) |
110 | { |
134 | { |
111 | JetiBox_printfxy(8,1,"%3i.%1iA ",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10); |
135 | JetiBox_printfxy(8,1,"%3i.%1iA ",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10); |
112 | } |
136 | } |
113 | 137 | ||
- | 138 | if(key== JETIBOX_KEY_UP) updatemotors = updatemotors+1; |
|
- | 139 | if(key== JETIBOX_KEY_DOWN) updatemotors = updatemotors-1; |
|
- | 140 | } |
|
- | 141 | ||
- | 142 | ||
- | 143 | void Menu_keynumber(uint8_t key) |
|
- | 144 | { |
|
- | 145 | pos1=0;pos2=0;pos3=0;pos4=0; |
|
- | 146 | if(keynumber <= 0 ) keynumber=1; |
|
- | 147 | if(keynumber >= 5 ) keynumber=1; |
|
- | 148 | if(keynumber== 1) pos1=0X3E;if(keynumber== 2) pos2=0X3E;if(keynumber== 3) pos3=0X3E;if(keynumber== 4) pos4=0X3E; |
|
- | 149 | if(key== JETIBOX_KEY_LEFT) keynumber--; |
|
- | 150 | if(key== JETIBOX_KEY_RIGHT) keynumber++; |
|
- | 151 | } |
|
- | 152 | ||
- | 153 | ||
- | 154 | void Menu_I2C(uint8_t key) |
|
- | 155 | { //0123456789ABCDEF |
|
- | 156 | ||
- | 157 | JetiBox_printfxy(0,0,"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); |
|
- | 158 | JetiBox_printfxy(0,1,"%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); |
|
114 | 159 | ||
115 | } |
160 | } |
116 | //1 |
161 | |
117 | //1 |
162 | |
118 | void Menu_SetPoint(uint8_t key) |
163 | void Menu_SetPoint(uint8_t key) |
119 | { //0123456789ABCDEF |
- | |
120 | JetiBox_printfxy(0,0,"%3i %3i %3i %3i", Motor[0].SetPoint, Motor[1].SetPoint, Motor[2].SetPoint, Motor[3].SetPoint); |
- | |
121 | JetiBox_printfxy(0,1,"%3i %3i %3i %3i", Motor[4].SetPoint, Motor[5].SetPoint, Motor[6].SetPoint, Motor[7].SetPoint); |
- | |
122 | if(RequiredMotors <= 4) |
- | |
123 | { |
- | |
124 | JetiBox_printfxy(0,1,"M SetPoint "); |
- | |
125 | } |
- | |
126 | else |
- | |
127 | if(RequiredMotors <= 6) |
- | |
128 | { |
- | |
129 | JetiBox_printfxy(8,1,"MSetP "); |
- | |
- | 164 | { //0123456789ABCDEF |
|
- | 165 | ||
- | 166 | loop1 ++; |
|
- | 167 | if(loop1 >= updatemotors) |
|
- | 168 | { |
|
- | 169 | loop1=0; |
|
- | 170 | Motors0 =Motor[0].SetPoint; |
|
- | 171 | Motors1 =Motor[1].SetPoint; |
|
- | 172 | Motors2 =Motor[2].SetPoint; |
|
- | 173 | Motors3 =Motor[3].SetPoint; |
|
- | 174 | Motors4 =Motor[4].SetPoint; |
|
- | 175 | Motors5 =Motor[5].SetPoint; |
|
- | 176 | Motors6 =Motor[6].SetPoint; |
|
- | 177 | Motors7 =Motor[7].SetPoint; |
|
- | 178 | } |
|
- | 179 | ||
- | 180 | JetiBox_printfxy(0,0,"%3i %3i %3i %3i", Motors0, Motors1, Motors2, Motors3); |
|
- | 181 | JetiBox_printfxy(0,1,"%3i %3i %3i %3i", Motors4, Motors5, Motors6, Motors7); |
|
- | 182 | if(RequiredMotors <= 4) |
|
- | 183 | { |
|
- | 184 | JetiBox_printfxy(0,1,"M SetPoint "); |
|
- | 185 | } |
|
- | 186 | else |
|
- | 187 | if(RequiredMotors <= 6) |
|
- | 188 | { |
|
- | 189 | JetiBox_printfxy(8,1,"MSetP%3i",updatemotors); |
|
- | 190 | } |
|
- | 191 | ||
- | 192 | /* |
|
- | 193 | JetiBox_printfxy(0,0,"%3i %3i %3i %3i", Motor[0].SetPoint, Motor[1].SetPoint, Motor[2].SetPoint, Motor[3].SetPoint); |
|
- | 194 | JetiBox_printfxy(0,1,"%3i %3i %3i %3i", Motor[4].SetPoint, Motor[5].SetPoint, Motor[6].SetPoint, Motor[7].SetPoint); |
|
- | 195 | if(RequiredMotors <= 4) |
|
- | 196 | { |
|
- | 197 | JetiBox_printfxy(0,1,"M SetPoint "); |
|
- | 198 | } |
|
- | 199 | else |
|
- | 200 | if(RequiredMotors <= 6) |
|
- | 201 | { |
|
- | 202 | JetiBox_printfxy(8,1,"MSetP "); |
|
- | 203 | } |
|
- | 204 | */ |
|
- | 205 | ||
- | 206 | if(key== JETIBOX_KEY_UP) updatemotors = updatemotors+1; |
|
130 | } |
207 | if(key== JETIBOX_KEY_DOWN) updatemotors = updatemotors-1; |
131 | 208 | ||
132 | } |
209 | } |
133 | 210 | ||
134 | void Menu_Integal(uint8_t key) |
211 | void Menu_Integal(uint8_t key) |
135 | { //0123456789ABCDEF |
212 | { //0123456789ABCDEF |
136 | int r=0; |
213 | int r=0; |
137 | int n=0; |
214 | int n=0; |
138 | int g=0; |
215 | int g=0; |
139 | n=SummeNick >> 9; |
216 | n=SummeNick >> 9; |
140 | r=SummeRoll >> 9; |
217 | r=SummeRoll >> 9; |
141 | g=Mess_Integral_Gier >> 9; |
218 | g=Mess_Integral_Gier >> 9; |
142 | 219 | ||
143 | JetiBox_printfxy(0,0,"%3iN %3iR +N",n, r); |
220 | JetiBox_printfxy(0,0,"%3iN %3iR +N",n, r); |
144 | JetiBox_printfxy(0,1,"%3iG +R -N -R",g); |
221 | JetiBox_printfxy(0,1,"%3iG +R -N -R",g); |
145 | //1 |
- | |
146 | - | ||
147 | - | ||
148 | } |
222 | } |
149 | 223 | ||
150 | void Menu_Info(uint8_t key) |
224 | void Menu_Info(uint8_t key) |
151 | { //0123456789ABCDEF |
225 | { //0123456789ABCDEF |
152 | 226 | ||
153 | JetiBox_printfxy(0,0,"%3i=Hovergas",HoverGas); |
227 | // JetiBox_printfxy(0,0,"%3i=Hovergas",HoverGas); |
154 | JetiBox_printfxy(0,1,"%3i=HG/4 %3i=Gas",HoverGas/4,StickGas); |
228 | JetiBox_printfxy(0,1,"%3i=HG/4 %3i=Gas",HoverGas/4,StickGas); |
155 | } |
229 | } |
156 | 230 | /* |
|
157 | void Menu_spoti1(uint8_t key) |
231 | void Menu_spoti1(uint8_t key) |
158 | { //0123456789ABCDEF |
232 | { //0123456789ABCDEF |
159 | 233 | ||
160 | JetiBox_printfxy(0,0,">%3i=Serialpot1",PPM_in[13]); |
234 | JetiBox_printfxy(0,0,">%3i=SPot1",PPM_in[13]); |
161 | JetiBox_printfxy(0,1," %3i=Serialpot2",PPM_in[14]); |
235 | JetiBox_printfxy(0,1," %3i=SPot2",PPM_in[14]); |
162 | if(key== JETIBOX_KEY_UP) PPM_in[13] = PPM_in[13]+1; |
236 | if(key== JETIBOX_KEY_UP) PPM_in[13] = PPM_in[13]+1; |
163 | if(key== JETIBOX_KEY_DOWN) PPM_in[13] = PPM_in[13]-1; |
237 | if(key== JETIBOX_KEY_DOWN) PPM_in[13] = PPM_in[13]-1; |
164 | } |
238 | } |
165 | 239 | ||
166 | void Menu_spoti2(uint8_t key) |
240 | void Menu_spoti2(uint8_t key) |
167 | { //0123456789ABCDEF |
241 | { //0123456789ABCDEF |
168 | 242 | ||
169 | JetiBox_printfxy(0,0," %3i=Serialpot1",PPM_in[13]); |
243 | JetiBox_printfxy(0,0," %3i=SPot1",PPM_in[13]); |
170 | JetiBox_printfxy(0,1,">%3i=Serialpot2",PPM_in[14],key); |
244 | JetiBox_printfxy(0,1,">%3i=SPot2",PPM_in[14],key); |
171 | if(key== JETIBOX_KEY_UP) PPM_in[14] = PPM_in[14]+5; |
245 | if(key== JETIBOX_KEY_UP) PPM_in[14] = PPM_in[14]+5; |
172 | if(key== JETIBOX_KEY_DOWN) PPM_in[14] = PPM_in[14]-5; |
246 | if(key== JETIBOX_KEY_DOWN) PPM_in[14] = PPM_in[14]-5; |
173 | } |
247 | } |
- | 248 | ||
- | 249 | */ |
|
- | 250 | void Menu_Serialpoti(uint8_t key) |
|
- | 251 | { |
|
- | 252 | Menu_keynumber(key); |
|
- | 253 | ||
- | 254 | JetiBox_printfxy(0,0,"%c%3i=SP1%c%3i=SP3",pos1,PPM_in[13],pos3,PPM_in[15]); |
|
- | 255 | JetiBox_printfxy(0,1,"%c%3i=SP2%c%3i=SP4",pos2,PPM_in[14],pos4,PPM_in[16]); |
|
- | 256 | ||
- | 257 | if((key== JETIBOX_KEY_UP ) & (keynumber ==1)) PPM_in[13] ++; |
|
- | 258 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==1)) PPM_in[13] --; |
|
- | 259 | if((key== JETIBOX_KEY_UP ) & (keynumber ==2)) PPM_in[14] ++; |
|
- | 260 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==2)) PPM_in[14] --; |
|
- | 261 | if((key== JETIBOX_KEY_UP ) & (keynumber ==3)) PPM_in[15] ++; |
|
- | 262 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==3)) PPM_in[15] --; |
|
- | 263 | if((key== JETIBOX_KEY_UP ) & (keynumber ==4)) PPM_in[16] ++; |
|
- | 264 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==4)) PPM_in[16] --; |
|
- | 265 | } |
|
- | 266 | ||
- | 267 | ||
174 | void Menu_hoeheD(uint8_t key) |
268 | void Menu_hoeheconf(uint8_t key) |
175 | { //0123456789ABCDEF |
269 | { //0123456789ABCDEF |
- | 270 | if(EE_Parameter.ExtraConfig == 3 || EE_Parameter.ExtraConfig == 1) //EE_Parameter.ExtraConfig == 1 =switched Hightv+ variopiepser |
|
- | 271 | { |
|
- | 272 | JetiBox_printfxy(0,0,"switched Hight v"); |
|
- | 273 | } |
|
- | 274 | if(EE_Parameter.ExtraConfig == 2 || EE_Parameter.ExtraConfig == 0) |
|
- | 275 | { |
|
- | 276 | JetiBox_printfxy(0,1,"Vario withbeep ^"); |
|
- | 277 | } |
|
- | 278 | /*/ |
|
- | 279 | vario =0 |
|
- | 280 | vario und ton 2 |
|
- | 281 | nur hohe = 1 |
|
- | 282 | höhe mit schalter=1 |
|
- | 283 | höhe mit variopiep =3 |
|
- | 284 | /*/ |
|
- | 285 | if(key== JETIBOX_KEY_UP) EE_Parameter.ExtraConfig = 3; |
|
- | 286 | if(key== JETIBOX_KEY_DOWN) EE_Parameter.ExtraConfig = 2; |
|
- | 287 | } |
|
- | 288 | ||
- | 289 | ||
- | 290 | ||
- | 291 | void Menu_hoehe1(uint8_t key) |
|
- | 292 | { |
|
- | 293 | Menu_keynumber(key); |
|
- | 294 | ||
- | 295 | JetiBox_printfxy(0,0,"%c%3i=HD %c%3i=HA",pos1,EE_Parameter.Luftdruck_D,pos3,EE_Parameter.Hoehe_ACC_Wirkung); |
|
- | 296 | JetiBox_printfxy(0,1,"%c%3i=HP %c%3i=HM",pos2,EE_Parameter.Hoehe_P,pos4,EE_Parameter.Hoehe_MinGas); |
|
- | 297 | ||
- | 298 | if((key== JETIBOX_KEY_UP ) & (keynumber ==1)) EE_Parameter.Luftdruck_D ++; |
|
- | 299 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==1)) EE_Parameter.Luftdruck_D --; |
|
- | 300 | if((key== JETIBOX_KEY_UP ) & (keynumber ==2)) EE_Parameter.Hoehe_P ++; |
|
- | 301 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==2)) EE_Parameter.Hoehe_P --; |
|
- | 302 | if((key== JETIBOX_KEY_UP ) & (keynumber ==3)) EE_Parameter.Hoehe_ACC_Wirkung ++; |
|
- | 303 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==3)) EE_Parameter.Hoehe_ACC_Wirkung --; |
|
- | 304 | if((key== JETIBOX_KEY_UP ) & (keynumber ==4)) EE_Parameter.Hoehe_MinGas ++; |
|
- | 305 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==4)) EE_Parameter.Hoehe_MinGas --; |
|
- | 306 | } |
|
- | 307 | ||
- | 308 | ||
- | 309 | void Menu_hoehe2(uint8_t key) |
|
- | 310 | { |
|
- | 311 | Menu_keynumber(key); |
|
- | 312 | ||
- | 313 | JetiBox_printfxy(0,0,"%c%3i=HV %c%3i=HZ",pos1,EE_Parameter.Hoehe_HoverBand,pos3,EE_Parameter.Hoehe_GPS_Z); |
|
- | 314 | JetiBox_printfxy(0,1,"%c%3i=HG %c%3i=HS",pos2,EE_Parameter.Hoehe_Verstaerkung,pos4,EE_Parameter.MaxHoehe); |
|
- | 315 | ||
- | 316 | if((key== JETIBOX_KEY_UP ) & (keynumber ==1)) EE_Parameter.Hoehe_HoverBand ++; |
|
- | 317 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==1)) EE_Parameter.Hoehe_HoverBand --; |
|
- | 318 | if((key== JETIBOX_KEY_UP ) & (keynumber ==2)) EE_Parameter.Hoehe_Verstaerkung ++; |
|
- | 319 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==2)) EE_Parameter.Hoehe_Verstaerkung --; |
|
- | 320 | if((key== JETIBOX_KEY_UP ) & (keynumber ==3)) EE_Parameter.Hoehe_GPS_Z ++; |
|
- | 321 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==3)) EE_Parameter.Hoehe_GPS_Z --; |
|
- | 322 | //if((key== JETIBOX_KEY_UP ) & (keynumber ==4)) EE_Parameter.MaxHoehe ++; |
|
- | 323 | //if((key== JETIBOX_KEY_DOWN) & (keynumber ==4)) EE_Parameter.MaxHoehe --; |
|
- | 324 | } |
|
- | 325 | ||
- | 326 | ||
- | 327 | void Menu_stick(uint8_t key) |
|
- | 328 | { |
|
- | 329 | Menu_keynumber(key); |
|
- | 330 | ||
- | 331 | JetiBox_printfxy(0,0,"%c%3i=StP%c%3i=SGP",pos1,EE_Parameter.Stick_P,pos3,EE_Parameter.Gier_P); |
|
- | 332 | JetiBox_printfxy(0,1,"%c%3i=StD%c%3i=DrC",pos2,EE_Parameter.Stick_D,pos4,EE_Parameter.Driftkomp); |
|
- | 333 | ||
- | 334 | if((key== JETIBOX_KEY_UP ) & (keynumber ==1)) EE_Parameter.Stick_P ++; |
|
- | 335 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==1)) EE_Parameter.Stick_P --; |
|
- | 336 | if((key== JETIBOX_KEY_UP ) & (keynumber ==2)) EE_Parameter.Stick_D ++; |
|
- | 337 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==2)) EE_Parameter.Stick_D --; |
|
- | 338 | if((key== JETIBOX_KEY_UP ) & (keynumber ==3)) EE_Parameter.Gier_P ++; |
|
- | 339 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==3)) EE_Parameter.Gier_P --; |
|
- | 340 | if((key== JETIBOX_KEY_UP ) & (keynumber ==4)) EE_Parameter.Driftkomp ++; |
|
- | 341 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==4)) EE_Parameter.Driftkomp --; |
|
- | 342 | } |
|
- | 343 | ||
- | 344 | ||
- | 345 | ||
- | 346 | void Menu_gyro(uint8_t key) |
|
- | 347 | { |
|
- | 348 | Menu_keynumber(key); |
|
- | 349 | ||
176 | 350 | ||
- | 351 | JetiBox_printfxy(0,0,"%c%3i=GYP%c%3i=GYI",pos1,EE_Parameter.Gyro_P,pos3,EE_Parameter.Gyro_I); |
|
- | 352 | JetiBox_printfxy(0,1,"%c%3i=GYD%c%3i=MaI",pos2,EE_Parameter.Gyro_D,pos4,EE_Parameter.I_Faktor); |
|
- | 353 | ||
- | 354 | if((key== JETIBOX_KEY_UP ) & (keynumber ==1)) EE_Parameter.Gyro_P ++; |
|
- | 355 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==1)) EE_Parameter.Gyro_P --; |
|
- | 356 | if((key== JETIBOX_KEY_UP ) & (keynumber ==2)) EE_Parameter.Gyro_D ++; |
|
- | 357 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==2)) EE_Parameter.Gyro_D --; |
|
- | 358 | if((key== JETIBOX_KEY_UP ) & (keynumber ==3)) EE_Parameter.Gyro_I ++; |
|
- | 359 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==3)) EE_Parameter.Gyro_I --; |
|
- | 360 | if((key== JETIBOX_KEY_UP ) & (keynumber ==4)) EE_Parameter.I_Faktor ++; |
|
- | 361 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==4)) EE_Parameter.I_Faktor --; |
|
- | 362 | } |
|
- | 363 | ||
- | 364 | void Menu_gps(uint8_t key) |
|
- | 365 | { |
|
- | 366 | Menu_keynumber(key); |
|
- | 367 | ||
- | 368 | ||
- | 369 | JetiBox_printfxy(0,0,"%c%3i=NGG%c%3i=NSC",pos1,EE_Parameter.NaviGpsGain,pos3,EE_Parameter.NaviSpeedCompensation); |
|
- | 370 | JetiBox_printfxy(0,1,"%c%3i=NWC%c%3i=NAL",pos2,EE_Parameter.NaviWindCorrection,pos4,EE_Parameter.NaviAngleLimitation); |
|
- | 371 | ||
- | 372 | if((key== JETIBOX_KEY_UP ) & (keynumber ==1)) EE_Parameter.NaviGpsGain ++; |
|
- | 373 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==1)) EE_Parameter.NaviGpsGain --; |
|
- | 374 | if((key== JETIBOX_KEY_UP ) & (keynumber ==2)) EE_Parameter.NaviWindCorrection ++; |
|
- | 375 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==2)) EE_Parameter.NaviWindCorrection --; |
|
- | 376 | if((key== JETIBOX_KEY_UP ) & (keynumber ==3)) EE_Parameter.NaviSpeedCompensation ++; |
|
- | 377 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==3)) EE_Parameter.NaviSpeedCompensation --; |
|
- | 378 | if((key== JETIBOX_KEY_UP ) & (keynumber ==4)) EE_Parameter.NaviAngleLimitation ++; |
|
- | 379 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==4)) EE_Parameter.NaviAngleLimitation --; |
|
- | 380 | } |
|
- | 381 | ||
- | 382 | ||
- | 383 | void Menu_LOOPconf(uint8_t key) |
|
- | 384 | { //0123456789ABCDEF |
|
- | 385 | ||
- | 386 | JetiBox_printfxy(0,0," "); |
|
- | 387 | ||
- | 388 | if(EE_Parameter.BitConfig & CFG_LOOP_LINKS) |
|
- | 389 | { |
|
- | 390 | LIBFC_JetiBox_Putchar(0x3C); |
|
- | 391 | LIBFC_JetiBox_Putchar(0x00); |
|
- | 392 | ||
- | 393 | } |
|
- | 394 | ||
- | 395 | if(EE_Parameter.BitConfig & CFG_LOOP_OBEN) |
|
- | 396 | { |
|
- | 397 | LIBFC_JetiBox_Putchar(0X5E); |
|
- | 398 | LIBFC_JetiBox_Putchar(0x00); |
|
- | 399 | ||
- | 400 | } |
|
- | 401 | ||
- | 402 | if(EE_Parameter.BitConfig & CFG_LOOP_UNTEN) |
|
- | 403 | { |
|
- | 404 | LIBFC_JetiBox_Putchar(0x76); |
|
- | 405 | LIBFC_JetiBox_Putchar(0x00); |
|
- | 406 | ||
- | 407 | } |
|
- | 408 | ||
- | 409 | if(EE_Parameter.BitConfig & CFG_LOOP_RECHTS) |
|
- | 410 | { |
|
- | 411 | LIBFC_JetiBox_Putchar(0X3E); |
|
- | 412 | } |
|
177 | JetiBox_printfxy(0,0,">%3i=HD",EE_Parameter.Luftdruck_D); |
413 | |
- | 414 | JetiBox_printfxy(0,1,"Loopingvalue %2id",EE_Parameter.BitConfig); |
|
178 | JetiBox_printfxy(0,1," %3i=HP",EE_Parameter.Hoehe_P); |
415 | |
179 | if(key== JETIBOX_KEY_UP) EE_Parameter.Luftdruck_D = EE_Parameter.Luftdruck_D+1; |
416 | if((key== JETIBOX_KEY_UP ) & (EE_Parameter.BitConfig <15 )) EE_Parameter.BitConfig ++; |
180 | if(key== JETIBOX_KEY_DOWN) EE_Parameter.Luftdruck_D = EE_Parameter.Luftdruck_D-1; |
417 | if((key== JETIBOX_KEY_DOWN) & (EE_Parameter.BitConfig >0 )) EE_Parameter.BitConfig --; |
- | 418 | } |
|
- | 419 | ||
181 | } |
420 | |
- | 421 | void Menu_loopP(uint8_t key) |
|
- | 422 | { |
|
- | 423 | Menu_keynumber(key); |
|
- | 424 | ||
- | 425 | JetiBox_printfxy(0,0,"%c%3i=LGL%c%3i=LHy",pos1,EE_Parameter.LoopGasLimit,pos3,EE_Parameter.LoopHysterese); |
|
- | 426 | JetiBox_printfxy(0,1,"%c%3i=LTh%c",pos2,EE_Parameter.LoopThreshold,pos4); |
|
- | 427 | ||
- | 428 | if((key== JETIBOX_KEY_UP ) & (keynumber ==1)) EE_Parameter.LoopGasLimit ++; |
|
- | 429 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==1)) EE_Parameter.LoopGasLimit --; |
|
- | 430 | if((key== JETIBOX_KEY_UP ) & (keynumber ==2)) EE_Parameter.LoopThreshold ++; |
|
- | 431 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==2)) EE_Parameter.LoopThreshold --; |
|
- | 432 | if((key== JETIBOX_KEY_UP ) & (keynumber ==3)) EE_Parameter.LoopHysterese ++; |
|
- | 433 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==3)) EE_Parameter.LoopHysterese --; |
|
- | 434 | //if((key== JETIBOX_KEY_UP ) & (keynumber ==4)) EE_Parameter.NaviAngleLimitation ++; |
|
- | 435 | //if((key== JETIBOX_KEY_DOWN) & (keynumber ==4)) EE_Parameter.NaviAngleLimitation --; |
|
- | 436 | } |
|
- | 437 | ||
- | 438 | ||
- | 439 | void Menu_coup(uint8_t key) |
|
- | 440 | { |
|
- | 441 | Menu_keynumber(key); |
|
- | 442 | ||
- | 443 | JetiBox_printfxy(0,0,"%c%3i=FGP%c%3i=CYC",pos1,EE_Parameter.AchsKopplung1,pos3,EE_Parameter.CouplingYawCorrection); |
|
- | 444 | JetiBox_printfxy(0,1,"%c%3i=FNR%c%3i=UP7",pos2,EE_Parameter.AchsKopplung2,pos4,EE_Parameter.UserParam7); |
|
- | 445 | ||
- | 446 | if((key== JETIBOX_KEY_UP ) & (keynumber ==1)) EE_Parameter.AchsKopplung1 ++; |
|
- | 447 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==1)) EE_Parameter.AchsKopplung1 --; |
|
- | 448 | if((key== JETIBOX_KEY_UP ) & (keynumber ==2)) EE_Parameter.AchsKopplung2 ++; |
|
- | 449 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==2)) EE_Parameter.AchsKopplung2 --; |
|
- | 450 | if((key== JETIBOX_KEY_UP ) & (keynumber ==3)) EE_Parameter.CouplingYawCorrection ++; |
|
- | 451 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==3)) EE_Parameter.CouplingYawCorrection --; |
|
- | 452 | if((key== JETIBOX_KEY_UP ) & (keynumber ==4)) EE_Parameter.UserParam7 ++; |
|
- | 453 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==4)) EE_Parameter.UserParam7 --; |
|
- | 454 | } |
|
- | 455 | ||
- | 456 | void Menu_gyroGandStab(uint8_t key) |
|
- | 457 | { |
|
- | 458 | Menu_keynumber(key); |
|
- | 459 | ||
- | 460 | JetiBox_printfxy(0,0,"%c%3i=GGP%c%3i=GSt",pos1,EE_Parameter.Gyro_Gier_P,pos3,EE_Parameter.Gyro_Stability); |
|
- | 461 | JetiBox_printfxy(0,1,"%c%3i=GGI%c%3i=DSt",pos2,EE_Parameter.Gyro_Gier_I,pos4,EE_Parameter.DynamicStability); |
|
- | 462 | ||
- | 463 | if((key== JETIBOX_KEY_UP ) & (keynumber ==1)) EE_Parameter.Gyro_Gier_P ++; |
|
- | 464 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==1)) EE_Parameter.Gyro_Gier_P --; |
|
- | 465 | if((key== JETIBOX_KEY_UP ) & (keynumber ==2)) EE_Parameter.Gyro_Gier_I ++; |
|
- | 466 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==2)) EE_Parameter.Gyro_Gier_I --; |
|
- | 467 | if((key== JETIBOX_KEY_UP ) & (keynumber ==3) & ( EE_Parameter.Gyro_Stability <15 )) EE_Parameter.Gyro_Stability ++; |
|
- | 468 | 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 ++; |
|
- | 470 | if((key== JETIBOX_KEY_DOWN) & (keynumber ==4)) EE_Parameter.DynamicStability --; |
|
- | 471 | } |
|
- | 472 | ||
182 | void Menu_hoeheP(uint8_t key) |
473 | void Menu_mtest(uint8_t key) |
- | 474 | { //0123456789ABCDEF |
|
- | 475 | //extern void LIBFC_JetiBox_Putchar(char c); |
|
- | 476 | ||
- | 477 | PC_MotortestActive = 240; |
|
- | 478 | ||
- | 479 | JetiBox_printfxy(0,0,"Mtest <+v <+^"); |
|
183 | { //0123456789ABCDEF |
480 | JetiBox_printfxy(0,1,"Motor=%3i Sp=%2i",loop3+1, MotorTest[loop3]); |
184 | 481 | ||
- | 482 | if((key== JETIBOX_KEY_UP) & (loop2 <100 )) loop2=loop2 +2;//GESCHW |
|
185 | JetiBox_printfxy(0,0," %3i=HD",EE_Parameter.Luftdruck_D); |
483 | if((key== JETIBOX_KEY_DOWN) & (loop2 >0 )) loop2=loop2 -2; |
186 | JetiBox_printfxy(0,1,">%3i=HP",EE_Parameter.Hoehe_P); |
484 | |
- | 485 | if((key== JETIBOX_KEY_UPANDL) & (loop3 <15 )) loop3 ++;//motornummer |
|
- | 486 | if((key==JETIBOX_KEY_DownANDL) & (loop3 >0 )) loop3 --; |
|
187 | if(key== JETIBOX_KEY_UP) EE_Parameter.Hoehe_P = EE_Parameter.Hoehe_P+1; |
487 | MotorTest[loop3]=loop2; |
- | 488 | ||
188 | if(key== JETIBOX_KEY_DOWN) EE_Parameter.Hoehe_P = EE_Parameter.Hoehe_P-1; |
489 | } |
189 | } |
490 | |
- | 491 | void Menu_mem(uint8_t key) |
|
- | 492 | { //0123456789ABCDEF |
|
190 | //#define JETIBOX_KEY_UP 0x2F |
493 | unsigned char i =0; |
191 | //#define JETIBOX_KEY_DOWN 0x4F |
494 | |
- | 495 | JetiBox_printfxy(0,0,"SETTING=%1i",GetActiveParamSet()); |
|
192 | //unsigned char Parameter_Luftdruck_D = 48; // Wert : 0-250 |
496 | JetiBox_printfxy(0,1,"< and > to STORE"); |
- | 497 | //if(key== JETIBOX_KEY_DOWN ) |
|
- | 498 | if(key== JETIBOX_KEY_LANDR && !MotorenEin) |
|
193 | //unsigned char Parameter_Hoehe_P = 16; // Wert : 0-32 |
499 | |
- | 500 | { |
|
- | 501 | ParamSet_WriteToEEProm(GetActiveParamSet()); |
|
- | 502 | ||
- | 503 | //for(i=0; i<5; i++) |
|
194 | //CHK_POTI_MM(Parameter_Luftdruck_D,EE_Parameter.Luftdruck_D,0,100); |
504 | //{ |
- | 505 | JetiBox_printfxy(i,0,"OK!"); |
|
- | 506 | //} |
|
- | 507 | ||
- | 508 | } |
|
- | 509 | ||
- | 510 | } |
|
195 | //CHK_POTI_MM(Parameter_Hoehe_P,EE_Parameter.Hoehe_P,0,100); |
511 | |
196 | //1 |
512 | |
197 | // ----------------------------------------------------------- |
513 | // ----------------------------------------------------------- |
198 | // the menu topology |
514 | // the menu topology |
199 | // ----------------------------------------------------------- |
515 | // ----------------------------------------------------------- |
200 | typedef void (*pFctMenu) (uint8_t); // the menu item handler function pointer |
516 | typedef void (*pFctMenu) (uint8_t); // the menu item handler function pointer |
201 | 517 | ||
202 | typedef struct{ |
518 | typedef struct{ |
203 | int8_t left; |
519 | int8_t left; |
204 | int8_t right; |
520 | int8_t right; |
205 | int8_t up; |
521 | int8_t up; |
206 | int8_t down; |
522 | int8_t down; |
207 | pFctMenu pHandler; |
523 | pFctMenu pHandler; |
208 | } MENU_ENTRY; |
524 | } MENU_ENTRY; |
209 | 525 | ||
210 | 526 | ||
211 | // the menu navigation structure |
527 | // the menu navigation structure |
212 | /* | |
528 | /* | |
213 | 529 | ||
214 | 3 - 0 - 1 - 2 - 3 - 0 |
530 | 3 - 0 - 1 - 2 - 3 - 0 |
215 | 531 | ||
216 | */ |
532 | */ |
217 | 533 | ||
218 | const MENU_ENTRY JetiBox_Menu[] PROGMEM= |
534 | const MENU_ENTRY JetiBox_Menu[] PROGMEM= |
219 | { // l r u d pHandler links rechts up down |
535 | { // l r u d pHandler links rechts up down |
220 | {11, 1, 0, 0, &Menu_Status }, // 0 /// |
536 | {23, 1, 0, 0, &Menu_Status }, // Seite 1 |
221 | {0, 2, 1, 1, &Menu_Temperature }, // 1 |
537 | { 0, 2, 1, 1, &Menu_Temperature }, // 2 |
222 | {1, 3, 2, 2, &Menu_Battery }, // 2 |
538 | { 1, 3, 2, 2, &Menu_Battery }, // 3 |
223 | {2, 4, 3, 3, &Menu_PosInfo }, // 3 |
539 | { 2, 4, 3, 3, &Menu_PosInfo }, // 4 |
224 | //1 |
- | |
225 | {3, 5, 4, 4, &Menu_Current }, // 4 /// |
540 | { 3, 5, 4, 4, &Menu_Current }, // 5 |
226 | {4, 6, 5, 5, &Menu_SetPoint }, // 5 /// |
541 | { 4, 6, 5, 5, &Menu_SetPoint }, // 6 |
227 | {5, 7, 6, 6, &Menu_Integal }, // 6 /// |
542 | { 5, 7, 6, 6, &Menu_I2C }, // 7 |
228 | {6, 8, 7, 7, &Menu_Info }, // 7 /// |
543 | { 6, 8, 7, 7, &Menu_Integal }, // 8 |
229 | {7, 9, 8, 8, &Menu_spoti1 }, // 8 /// |
544 | { 7, 9, 8, 8, &Menu_Info }, // 9 |
230 | {8, 10, 9, 9, &Menu_spoti2 }, // 9 /// |
545 | { 8, 10, 9, 9, &Menu_Serialpoti }, // 10 |
231 | {9, 11, 10, 10, &Menu_hoeheD }, // 10 /// |
546 | { 9, 11, 10, 10, &Menu_hoehe1 }, // 11 |
232 | {10, 0, 11, 11, &Menu_hoeheP }, // 11 /// |
547 | {10, 12, 11, 11, &Menu_hoehe2 }, // 12 |
- | 548 | {11, 13, 12, 12, &Menu_stick }, // 13 |
|
- | 549 | {12, 14, 13, 13, &Menu_gyro }, // 14 |
|
- | 550 | {13, 15, 14, 14, &Menu_gyroGandStab }, // 15 |
|
- | 551 | {14, 16, 15, 15, &Menu_gps }, // 16 |
|
- | 552 | {15, 17, 16, 16, &Menu_loopP }, // 17 |
|
- | 553 | {16, 18, 17, 17, &Menu_coup }, // 18 |
|
- | 554 | {17, 19, 18, 18, &Menu_LOOPconf }, // 19 |
|
- | 555 | {18, 20, 19, 19, &Menu_hoeheconf }, // 20 |
|
- | 556 | {19, 21, 20, 20, &Menu_mtest }, // 21 |
|
- | 557 | {20, 22, 21, 21, &Menu_mem }, // 22 |
|
- | 558 | {21, 0, 22, 22, &Menu_mem }, // 23 |
|
233 | 559 | ||
234 | //1 |
- | |
235 | }; |
560 | }; |
236 | 561 | ||
237 | // ----------------------------------------------------------- |
562 | // ----------------------------------------------------------- |
238 | // Update display buffer |
563 | // Update display buffer |
239 | // ----------------------------------------------------------- |
564 | // ----------------------------------------------------------- |
240 | unsigned char JetiBox_Update(unsigned char key) |
565 | unsigned char JetiBox_Update(unsigned char key) |
241 | { |
566 | { |
- | 567 | //printf(" %3i = keynumber, pos1 =%3i \n\r ", pos1); /// |
|
- | 568 | ||
242 | static uint8_t item = 0, last_item = 0; // the menu item |
569 | static uint8_t item = 0, last_item = 0; // the menu item |
243 | 570 | ||
244 | // navigate within the menu by key action |
571 | // navigate within the menu by key action |
245 | last_item = item; |
572 | last_item = item; |
246 | switch(key) |
573 | switch(key) |
247 | { |
574 | { |
248 | case JETIBOX_KEY_LEFT: |
575 | case JETIBOX_KEY_LEFT: |
249 | if (item == 0) return (1); // switch back to jeti expander menu |
576 | if (item == 0) return (1); // switch back to jeti expander menu |
- | 577 | else |
|
- | 578 | { |
|
- | 579 | if (keynumber <= 0 || keynumber >=5) //keynumber normaly 0, only in the parameter pages keyn=1...4 |
|
- | 580 | { |
|
250 | else item = pgm_read_byte(&JetiBox_Menu[item].left); //trigger to left menu item |
581 | item = pgm_read_byte(&JetiBox_Menu[item].left); //trigger to left menu item |
- | 582 | } |
|
- | 583 | } |
|
- | 584 | ||
251 | break; |
585 | break; |
252 | case JETIBOX_KEY_RIGHT: |
586 | case JETIBOX_KEY_RIGHT: |
- | 587 | if (keynumber <= 0 || keynumber >=5) |
|
- | 588 | { |
|
253 | item = pgm_read_byte(&JetiBox_Menu[item].right); //trigger to right menu item |
589 | item = pgm_read_byte(&JetiBox_Menu[item].right); //trigger to right menu item |
- | 590 | } |
|
254 | break; |
591 | break; |
255 | case JETIBOX_KEY_UP: |
592 | case JETIBOX_KEY_UP: |
256 | item = pgm_read_byte(&JetiBox_Menu[item].up); //trigger to up menu item |
593 | item = pgm_read_byte(&JetiBox_Menu[item].up); //trigger to up menu item |
257 | break; |
594 | break; |
258 | case JETIBOX_KEY_DOWN: |
595 | case JETIBOX_KEY_DOWN: |
259 | item = pgm_read_byte(&JetiBox_Menu[item].down); //trigger to down menu item |
596 | item = pgm_read_byte(&JetiBox_Menu[item].down); //trigger to down menu item |
260 | break; |
597 | break; |
- | 598 | ||
- | 599 | case JETIBOX_KEY_NONE: /// |
|
- | 600 | if (keynumber == 5 ) |
|
- | 601 | { |
|
- | 602 | item = pgm_read_byte(&JetiBox_Menu[item].right); //trigger to right menu item |
|
- | 603 | keynumber=6; |
|
- | 604 | } |
|
- | 605 | ||
- | 606 | if (keynumber == 0) //keynumber normaly 0, only in the parameter pages keyn=1...4 |
|
- | 607 | { |
|
- | 608 | item = pgm_read_byte(&JetiBox_Menu[item].left); //trigger to left menu item |
|
- | 609 | keynumber=-1; |
|
- | 610 | ||
- | 611 | } |
|
- | 612 | break; |
|
- | 613 | ||
261 | default: |
614 | default: |
262 | break; |
615 | break; |
263 | } |
616 | } |
264 | // if the menu item has been changed, do not pass the key to the item handler |
617 | // if the menu item has been changed, do not pass the key to the item handler |
265 | // to avoid jumping over to items |
618 | // to avoid jumping over to items |
266 | if(item != last_item) key = JETIBOX_KEY_UNDEF; |
619 | if(item != last_item) key = JETIBOX_KEY_UNDEF; |
267 | 620 | ||
268 | LIBFC_JetiBox_Clear(); |
621 | LIBFC_JetiBox_Clear(); |
269 | //execute menu item handler |
622 | //execute menu item handler |
270 | ((pFctMenu)(pgm_read_word(&(JetiBox_Menu[item].pHandler))))(key); |
623 | ((pFctMenu)(pgm_read_word(&(JetiBox_Menu[item].pHandler))))(key); |
271 | 624 | ||
272 | return (0); |
625 | return (0); |
273 | } |
626 | } |
274 | 627 | ||
275 | 628 |