Rev 318 | Rev 321 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 318 | Rev 320 | ||
---|---|---|---|
1 | /*#######################################################################################*/ |
1 | /*#######################################################################################*/ |
2 | /* !!! THIS IS NOT FREE SOFTWARE !!! */ |
2 | /* !!! THIS IS NOT FREE SOFTWARE !!! */ |
3 | /*#######################################################################################*/ |
3 | /*#######################################################################################*/ |
4 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
4 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
5 | // + Copyright (c) 2008 Ingo Busker, Holger Buss |
5 | // + Copyright (c) 2008 Ingo Busker, Holger Buss |
6 | // + Nur für den privaten Gebrauch / NON-COMMERCIAL USE ONLY |
6 | // + Nur für den privaten Gebrauch / NON-COMMERCIAL USE ONLY |
7 | // + FOR NON COMMERCIAL USE ONLY |
7 | // + FOR NON COMMERCIAL USE ONLY |
8 | // + www.MikroKopter.com |
8 | // + www.MikroKopter.com |
9 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
9 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
10 | // + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
10 | // + Es gilt für das gesamte Projekt (Hardware, Software, Binärfiles, Sourcecode und Dokumentation), |
11 | // + dass eine Nutzung (auch auszugsweise) nur für den privaten (nicht-kommerziellen) Gebrauch zulässig ist. |
11 | // + dass eine Nutzung (auch auszugsweise) nur für den privaten (nicht-kommerziellen) Gebrauch zulässig ist. |
12 | // + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
12 | // + Sollten direkte oder indirekte kommerzielle Absichten verfolgt werden, ist mit uns (info@mikrokopter.de) Kontakt |
13 | // + bzgl. der Nutzungsbedingungen aufzunehmen. |
13 | // + bzgl. der Nutzungsbedingungen aufzunehmen. |
14 | // + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
14 | // + Eine kommerzielle Nutzung ist z.B.Verkauf von MikroKoptern, Bestückung und Verkauf von Platinen oder Bausätzen, |
15 | // + Verkauf von Luftbildaufnahmen, usw. |
15 | // + Verkauf von Luftbildaufnahmen, usw. |
16 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
16 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
17 | // + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
17 | // + Werden Teile des Quellcodes (mit oder ohne Modifikation) weiterverwendet oder veröffentlicht, |
18 | // + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
18 | // + unterliegen sie auch diesen Nutzungsbedingungen und diese Nutzungsbedingungen incl. Copyright müssen dann beiliegen |
19 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
19 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
20 | // + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
20 | // + Sollte die Software (auch auszugesweise) oder sonstige Informationen des MikroKopter-Projekts |
21 | // + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
21 | // + auf anderen Webseiten oder sonstigen Medien veröffentlicht werden, muss unsere Webseite "http://www.mikrokopter.de" |
22 | // + eindeutig als Ursprung verlinkt werden |
22 | // + eindeutig als Ursprung verlinkt werden |
23 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
23 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
24 | // + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
24 | // + Keine Gewähr auf Fehlerfreiheit, Vollständigkeit oder Funktion |
25 | // + Benutzung auf eigene Gefahr |
25 | // + Benutzung auf eigene Gefahr |
26 | // + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
26 | // + Wir übernehmen keinerlei Haftung für direkte oder indirekte Personen- oder Sachschäden |
27 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
27 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
28 | // + Die Portierung oder Nutzung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
28 | // + Die Portierung oder Nutzung der Software (oder Teile davon) auf andere Systeme (ausser der Hardware von www.mikrokopter.de) ist nur |
29 | // + mit unserer Zustimmung zulässig |
29 | // + mit unserer Zustimmung zulässig |
30 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
30 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
31 | // + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
31 | // + Die Funktion printf_P() unterliegt ihrer eigenen Lizenz und ist hiervon nicht betroffen |
32 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
32 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
33 | // + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
33 | // + Redistributions of source code (with or without modifications) must retain the above copyright notice, |
34 | // + this list of conditions and the following disclaimer. |
34 | // + this list of conditions and the following disclaimer. |
35 | // + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
35 | // + * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived |
36 | // + from this software without specific prior written permission. |
36 | // + from this software without specific prior written permission. |
37 | // + * The use of this project (hardware, software, binary files, sources and documentation) is only permitted |
37 | // + * The use of this project (hardware, software, binary files, sources and documentation) is only permitted |
38 | // + for non-commercial use (directly or indirectly) |
38 | // + for non-commercial use (directly or indirectly) |
39 | // + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
39 | // + Commercial use (for excample: selling of MikroKopters, selling of PCBs, assembly, ...) is only permitted |
40 | // + with our written permission |
40 | // + with our written permission |
41 | // + * If sources or documentations are redistributet on other webpages, out webpage (http://www.MikroKopter.de) must be |
41 | // + * If sources or documentations are redistributet on other webpages, out webpage (http://www.MikroKopter.de) must be |
42 | // + clearly linked as origin |
42 | // + clearly linked as origin |
43 | // + * porting the sources to other systems or using the software on other systems (except hardware from www.mikrokopter.de) is not allowed |
43 | // + * porting the sources to other systems or using the software on other systems (except hardware from www.mikrokopter.de) is not allowed |
44 | // |
44 | // |
45 | // + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
45 | // + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
46 | // + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
46 | // + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
47 | // + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
47 | // + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
48 | // + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
48 | // + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
49 | // + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
49 | // + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
50 | // + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
50 | // + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
51 | // + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
51 | // + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
52 | // + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
52 | // + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
53 | // + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
53 | // + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
54 | // + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
54 | // + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
55 | // + POSSIBILITY OF SUCH DAMAGE. |
55 | // + POSSIBILITY OF SUCH DAMAGE. |
56 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
56 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
57 | #include <stdlib.h> |
57 | #include <stdlib.h> |
58 | #include "91x_lib.h" |
58 | #include "91x_lib.h" |
59 | #include "main.h" |
59 | #include "main.h" |
60 | #include "led.h" |
60 | #include "led.h" |
61 | #include "ubx.h" |
61 | #include "ubx.h" |
62 | #include "GPS.h" |
62 | #include "GPS.h" |
63 | #include "timer1.h" |
63 | #include "timer1.h" |
64 | #include "compass.h" |
64 | #include "compass.h" |
65 | #include "spi_slave.h" |
65 | #include "spi_slave.h" |
66 | #include "menu.h" |
66 | #include "menu.h" |
67 | #include "uart1.h" |
67 | #include "uart1.h" |
68 | #include "ncmag.h" |
68 | #include "ncmag.h" |
69 | 69 | ||
70 | u8 DispPtr = 0; |
70 | u8 DispPtr = 0; |
71 | s8 DisplayBuff[DISPLAYBUFFSIZE]; |
71 | s8 DisplayBuff[DISPLAYBUFFSIZE]; |
72 | 72 | ||
73 | 73 | ||
74 | u8 MenuItem = 0; |
74 | u8 MenuItem = 0; |
75 | u8 MaxMenuItem = 15; |
75 | u8 MaxMenuItem = 16; |
76 | 76 | ||
77 | 77 | ||
78 | 78 | ||
79 | void Menu_Putchar(char c) |
79 | void Menu_Putchar(char c) |
80 | { |
80 | { |
81 | if(DispPtr < DISPLAYBUFFSIZE) DisplayBuff[DispPtr++] = c; ; |
81 | if(DispPtr < DISPLAYBUFFSIZE) DisplayBuff[DispPtr++] = c; ; |
82 | } |
82 | } |
83 | 83 | ||
84 | void Menu_Clear(void) |
84 | void Menu_Clear(void) |
85 | { |
85 | { |
86 | u8 i; |
86 | u8 i; |
87 | for( i = 0; i < DISPLAYBUFFSIZE; i++) DisplayBuff[i] = ' '; |
87 | for( i = 0; i < DISPLAYBUFFSIZE; i++) DisplayBuff[i] = ' '; |
88 | } |
88 | } |
89 | 89 | ||
90 | 90 | ||
91 | // Display with 20 characters in 4 lines |
91 | // Display with 20 characters in 4 lines |
92 | void Menu_Update(u8 Keys) |
92 | void Menu_Update(u8 Keys) |
93 | { |
93 | { |
94 | s32 i1,i2; |
94 | s32 i1,i2; |
95 | u8 sign; |
95 | u8 sign; |
96 | 96 | ||
97 | if(Keys & KEY1) { if(MenuItem > 0) MenuItem--; else MenuItem = MaxMenuItem;} |
97 | if(Keys & KEY1) { if(MenuItem > 0) MenuItem--; else MenuItem = MaxMenuItem;} |
98 | if(Keys & KEY2) { if(MenuItem == MaxMenuItem) MenuItem = 0; else MenuItem++;} |
98 | if(Keys & KEY2) { if(MenuItem == MaxMenuItem) MenuItem = 0; else MenuItem++;} |
99 | if((Keys & KEY1) && (Keys & KEY2)) MenuItem = 0; |
99 | if((Keys & KEY1) && (Keys & KEY2)) MenuItem = 0; |
100 | if(MenuItem > MaxMenuItem) MenuItem = MaxMenuItem; |
100 | if(MenuItem > MaxMenuItem) MenuItem = MaxMenuItem; |
101 | Menu_Clear(); |
101 | Menu_Clear(); |
102 | // print menu item number in the upper right corner |
102 | // print menu item number in the upper right corner |
103 | if(MenuItem < 10) |
103 | if(MenuItem < 10) |
104 | { |
104 | { |
105 | LCD_printfxy(17,0,"[%i]",MenuItem); |
105 | LCD_printfxy(17,0,"[%i]",MenuItem); |
106 | } |
106 | } |
107 | else // Menuitem >= 10 |
107 | else // Menuitem >= 10 |
108 | { |
108 | { |
109 | LCD_printfxy(16,0,"[%i]",MenuItem); |
109 | LCD_printfxy(16,0,"[%i]",MenuItem); |
110 | } |
110 | } |
111 | 111 | ||
112 | switch(MenuItem) |
112 | switch(MenuItem) |
113 | { |
113 | { |
114 | // Version Info |
114 | // Version Info |
115 | case 0: |
115 | case 0: |
116 | LCD_printfxy(0,0,"++ Navi-Ctrl ++"); |
116 | LCD_printfxy(0,0,"++ Navi-Ctrl ++"); |
117 | LCD_printfxy(0,1,"HW V%d.%d SW V%d.%d%c", Version_HW/10, Version_HW%10, VERSION_MAJOR, VERSION_MINOR, 'a'+ VERSION_PATCH); |
117 | LCD_printfxy(0,1,"HW V%d.%d SW V%d.%d%c", Version_HW/10, Version_HW%10, VERSION_MAJOR, VERSION_MINOR, 'a'+ VERSION_PATCH); |
118 | if(ErrorCode) |
118 | if(ErrorCode) |
119 | { |
119 | { |
120 | LCD_printfxy(0,2,"Error: %d",ErrorCode); |
120 | LCD_printfxy(0,2,"Error: %d",ErrorCode); |
121 | LCD_printfxy(0,3,"%s",ErrorMSG); |
121 | LCD_printfxy(0,3,"%s",ErrorMSG); |
122 | } |
122 | } |
123 | else LCD_printfxy(0,3,"(c) Buss, Busker"); |
123 | else LCD_printfxy(0,3,"(c) Buss, Busker"); |
124 | break; |
124 | break; |
125 | case 1: |
125 | case 1: |
126 | if (GPSData.Status == INVALID) |
126 | if (GPSData.Status == INVALID) |
127 | { |
127 | { |
128 | LCD_printfxy(0,0,"No GPS data"); |
128 | LCD_printfxy(0,0,"No GPS data"); |
129 | LCD_printfxy(0,1,"Lon: "); |
129 | LCD_printfxy(0,1,"Lon: "); |
130 | LCD_printfxy(0,2,"Lat: "); |
130 | LCD_printfxy(0,2,"Lat: "); |
131 | LCD_printfxy(0,3,"Alt: "); |
131 | LCD_printfxy(0,3,"Alt: "); |
132 | } |
132 | } |
133 | else // newdata or processed |
133 | else // newdata or processed |
134 | { |
134 | { |
135 | LCD_printfxy(0,0,"Sat:%02d ", GPSData.NumOfSats); |
135 | LCD_printfxy(0,0,"Sat:%02d ", GPSData.NumOfSats); |
136 | switch (GPSData.SatFix) |
136 | switch (GPSData.SatFix) |
137 | { |
137 | { |
138 | case SATFIX_NONE: |
138 | case SATFIX_NONE: |
139 | LCD_printfxy(7,0,"NoFix"); |
139 | LCD_printfxy(7,0,"NoFix"); |
140 | break; |
140 | break; |
141 | case SATFIX_2D: |
141 | case SATFIX_2D: |
142 | LCD_printfxy(7,0,"2DFix"); |
142 | LCD_printfxy(7,0,"2DFix"); |
143 | break; |
143 | break; |
144 | case SATFIX_3D: |
144 | case SATFIX_3D: |
145 | LCD_printfxy(7,0,"3DFix"); |
145 | LCD_printfxy(7,0,"3DFix"); |
146 | break; |
146 | break; |
147 | default: |
147 | default: |
148 | LCD_printfxy(7,0,"??Fix"); |
148 | LCD_printfxy(7,0,"??Fix"); |
149 | break; |
149 | break; |
150 | } |
150 | } |
151 | if(GPSData.Flags & FLAG_DIFFSOLN) |
151 | if(GPSData.Flags & FLAG_DIFFSOLN) |
152 | { |
152 | { |
153 | LCD_printfxy(12,0,"/DGPS"); |
153 | LCD_printfxy(12,0,"/DGPS"); |
154 | } |
154 | } |
155 | else |
155 | else |
156 | { |
156 | { |
157 | LCD_printfxy(12,0," "); |
157 | LCD_printfxy(12,0," "); |
158 | } |
158 | } |
159 | 159 | ||
160 | if(GPSData.Position.Longitude < 0) sign = '-'; |
160 | if(GPSData.Position.Longitude < 0) sign = '-'; |
161 | else sign = '+'; |
161 | else sign = '+'; |
162 | i1 = abs(GPSData.Position.Longitude)/10000000L; |
162 | i1 = abs(GPSData.Position.Longitude)/10000000L; |
163 | i2 = abs(GPSData.Position.Longitude)%10000000L; |
163 | i2 = abs(GPSData.Position.Longitude)%10000000L; |
164 | LCD_printfxy(0,1,"Lon:%c%03ld.%07ld deg",sign, i1, i2); |
164 | LCD_printfxy(0,1,"Lon:%c%03ld.%07ld deg",sign, i1, i2); |
165 | if(GPSData.Position.Latitude < 0) sign = '-'; |
165 | if(GPSData.Position.Latitude < 0) sign = '-'; |
166 | else sign = '+'; |
166 | else sign = '+'; |
167 | i1 = abs(GPSData.Position.Latitude)/10000000L; |
167 | i1 = abs(GPSData.Position.Latitude)/10000000L; |
168 | i2 = abs(GPSData.Position.Latitude)%10000000L; |
168 | i2 = abs(GPSData.Position.Latitude)%10000000L; |
169 | LCD_printfxy(0,2,"Lat:%c%03ld.%07ld deg",sign, i1, i2); |
169 | LCD_printfxy(0,2,"Lat:%c%03ld.%07ld deg",sign, i1, i2); |
170 | if(GPSData.Position.Altitude < 0) sign = '-'; |
170 | if(GPSData.Position.Altitude < 0) sign = '-'; |
171 | else sign = '+'; |
171 | else sign = '+'; |
172 | i1 = abs(GPSData.Position.Altitude)/1000L; |
172 | i1 = abs(GPSData.Position.Altitude)/1000L; |
173 | i2 = abs(GPSData.Position.Altitude)%1000L; |
173 | i2 = abs(GPSData.Position.Altitude)%1000L; |
174 | LCD_printfxy(0,3,"Alt:%c%04ld.%03ld m", sign, i1, i2); |
174 | LCD_printfxy(0,3,"Alt:%c%04ld.%03ld m", sign, i1, i2); |
175 | } |
175 | } |
176 | break; |
176 | break; |
177 | case 2: |
177 | case 2: |
178 | if (GPSData.Status == INVALID) |
178 | if (GPSData.Status == INVALID) |
179 | { |
179 | { |
180 | LCD_printfxy(0,0,"No GPS data"); |
180 | LCD_printfxy(0,0,"No GPS data"); |
181 | LCD_printfxy(0,1,"Speed N: "); |
181 | LCD_printfxy(0,1,"Speed N: "); |
182 | LCD_printfxy(0,2,"Speed E: "); |
182 | LCD_printfxy(0,2,"Speed E: "); |
183 | LCD_printfxy(0,3,"Speed T: "); |
183 | LCD_printfxy(0,3,"Speed T: "); |
184 | } |
184 | } |
185 | else // newdata or processed |
185 | else // newdata or processed |
186 | { |
186 | { |
187 | LCD_printfxy(0,0,"Sat:%02d ", GPSData.NumOfSats); |
187 | LCD_printfxy(0,0,"Sat:%02d ", GPSData.NumOfSats); |
188 | switch (GPSData.SatFix) |
188 | switch (GPSData.SatFix) |
189 | { |
189 | { |
190 | case SATFIX_NONE: |
190 | case SATFIX_NONE: |
191 | LCD_printfxy(7,0,"NoFix"); |
191 | LCD_printfxy(7,0,"NoFix"); |
192 | break; |
192 | break; |
193 | case SATFIX_2D: |
193 | case SATFIX_2D: |
194 | LCD_printfxy(7,0,"2DFix"); |
194 | LCD_printfxy(7,0,"2DFix"); |
195 | break; |
195 | break; |
196 | case SATFIX_3D: |
196 | case SATFIX_3D: |
197 | LCD_printfxy(7,0,"3DFix"); |
197 | LCD_printfxy(7,0,"3DFix"); |
198 | break; |
198 | break; |
199 | default: |
199 | default: |
200 | LCD_printfxy(7,0,"??Fix"); |
200 | LCD_printfxy(7,0,"??Fix"); |
201 | break; |
201 | break; |
202 | } |
202 | } |
203 | if(GPSData.Flags & FLAG_DIFFSOLN) |
203 | if(GPSData.Flags & FLAG_DIFFSOLN) |
204 | { |
204 | { |
205 | LCD_printfxy(12,0,"/DGPS"); |
205 | LCD_printfxy(12,0,"/DGPS"); |
206 | } |
206 | } |
207 | else |
207 | else |
208 | { |
208 | { |
209 | LCD_printfxy(12,0," "); |
209 | LCD_printfxy(12,0," "); |
210 | } |
210 | } |
211 | 211 | ||
212 | LCD_printfxy(0,1,"Speed N: %+4ld cm/s",GPSData.Speed_North); |
212 | LCD_printfxy(0,1,"Speed N: %+4ld cm/s",GPSData.Speed_North); |
213 | LCD_printfxy(0,2,"Speed E: %+4ld cm/s",GPSData.Speed_East); |
213 | LCD_printfxy(0,2,"Speed E: %+4ld cm/s",GPSData.Speed_East); |
214 | LCD_printfxy(0,3,"Speed T: %+4ld cm/s",GPSData.Speed_Top); |
214 | LCD_printfxy(0,3,"Speed T: %+4ld cm/s",GPSData.Speed_Top); |
215 | } |
215 | } |
216 | break; |
216 | break; |
217 | case 3: |
217 | case 3: |
218 | LCD_printfxy(0,0,"GPS UTC Time"); |
218 | LCD_printfxy(0,0,"GPS UTC Time"); |
219 | if (!SystemTime.Valid) |
219 | if (!SystemTime.Valid) |
220 | { |
220 | { |
221 | LCD_printfxy(0,1," "); |
221 | LCD_printfxy(0,1," "); |
222 | LCD_printfxy(0,2," No time data! "); |
222 | LCD_printfxy(0,2," No time data! "); |
223 | LCD_printfxy(0,3," "); |
223 | LCD_printfxy(0,3," "); |
224 | } |
224 | } |
225 | else // newdata or processed |
225 | else // newdata or processed |
226 | { |
226 | { |
227 | LCD_printfxy(0,1," "); |
227 | LCD_printfxy(0,1," "); |
228 | LCD_printfxy(0,2,"Date: %02i/%02i/%04i",SystemTime.Month, SystemTime.Day, SystemTime.Year); |
228 | LCD_printfxy(0,2,"Date: %02i/%02i/%04i",SystemTime.Month, SystemTime.Day, SystemTime.Year); |
229 | LCD_printfxy(0,3,"Time: %02i:%02i:%02i.%03i", SystemTime.Hour, SystemTime.Min, SystemTime.Sec, SystemTime.mSec); |
229 | LCD_printfxy(0,3,"Time: %02i:%02i:%02i.%03i", SystemTime.Hour, SystemTime.Min, SystemTime.Sec, SystemTime.mSec); |
230 | } |
230 | } |
231 | break; |
231 | break; |
232 | case 4: // Navi Params 1 from FC |
232 | case 4: // Navi Params 1 from FC |
233 | LCD_printfxy(0,0,"NaviMode: %3i" , Parameter.NaviGpsModeControl); |
233 | LCD_printfxy(0,0,"NaviMode: %3i" , Parameter.NaviGpsModeControl); |
234 | LCD_printfxy(0,1,"G :%3i P :%3i ",Parameter.NaviGpsGain, Parameter.NaviGpsP); |
234 | LCD_printfxy(0,1,"G :%3i P :%3i ",Parameter.NaviGpsGain, Parameter.NaviGpsP); |
235 | LCD_printfxy(0,2,"I :%3i D :%3i ",Parameter.NaviGpsI, Parameter.NaviGpsD); |
235 | LCD_printfxy(0,2,"I :%3i D :%3i ",Parameter.NaviGpsI, Parameter.NaviGpsD); |
236 | LCD_printfxy(0,3,"ACC:%3i SAT:%3i ",Parameter.NaviGpsACC, Parameter.NaviGpsMinSat); |
236 | LCD_printfxy(0,3,"ACC:%3i SAT:%3i ",Parameter.NaviGpsACC, Parameter.NaviGpsMinSat); |
237 | break; |
237 | break; |
238 | case 5: // Navi Params 2 from FC |
238 | case 5: // Navi Params 2 from FC |
239 | LCD_printfxy(0,0,"Stick TS: %3i", Parameter.NaviStickThreshold); |
239 | LCD_printfxy(0,0,"Stick TS: %3i", Parameter.NaviStickThreshold); |
240 | LCD_printfxy(0,1,"MaxRadius: %3i m", NaviData.OperatingRadius); |
240 | LCD_printfxy(0,1,"MaxRadius: %3i m", NaviData.OperatingRadius); |
241 | LCD_printfxy(0,2,"WindCorr: %3i", Parameter.NaviWindCorrection); |
241 | LCD_printfxy(0,2,"WindCorr: %3i", Parameter.NaviWindCorrection); |
242 | LCD_printfxy(0,3,"SpeedComp: %3i", Parameter.NaviSpeedCompensation); |
242 | LCD_printfxy(0,3,"SpeedComp: %3i", Parameter.NaviSpeedCompensation); |
243 | break; |
243 | break; |
244 | case 6: // Navi Params 3 from FC |
244 | case 6: // Navi Params 3 from FC |
245 | LCD_printfxy(0,0,"Angle-Limit: %3i", Parameter.NaviAngleLimitation); |
245 | LCD_printfxy(0,0,"Angle-Limit: %3i", Parameter.NaviAngleLimitation); |
246 | LCD_printfxy(0,1," P-Limit: %3i", Parameter.NaviGpsPLimit); |
246 | LCD_printfxy(0,1," P-Limit: %3i", Parameter.NaviGpsPLimit); |
247 | LCD_printfxy(0,2," I-Limit: %3i", Parameter.NaviGpsILimit); |
247 | LCD_printfxy(0,2," I-Limit: %3i", Parameter.NaviGpsILimit); |
248 | LCD_printfxy(0,3," D-Limit: %3i", Parameter.NaviGpsDLimit); |
248 | LCD_printfxy(0,3," D-Limit: %3i", Parameter.NaviGpsDLimit); |
249 | break; |
249 | break; |
250 | case 7: |
250 | case 7: |
251 | LCD_printfxy(0,0,"Home Position"); |
251 | LCD_printfxy(0,0,"Home Position"); |
252 | if(NaviData.HomePosition.Status == INVALID) |
252 | if(NaviData.HomePosition.Status == INVALID) |
253 | { |
253 | { |
254 | LCD_printfxy(0,1," "); |
254 | LCD_printfxy(0,1," "); |
255 | LCD_printfxy(0,2," Is not set. "); |
255 | LCD_printfxy(0,2," Is not set. "); |
256 | LCD_printfxy(0,3," "); |
256 | LCD_printfxy(0,3," "); |
257 | } |
257 | } |
258 | else |
258 | else |
259 | { |
259 | { |
260 | if(NaviData.HomePosition.Longitude < 0) sign = '-'; |
260 | if(NaviData.HomePosition.Longitude < 0) sign = '-'; |
261 | else sign = '+'; |
261 | else sign = '+'; |
262 | i1 = abs(NaviData.HomePosition.Longitude)/10000000L; |
262 | i1 = abs(NaviData.HomePosition.Longitude)/10000000L; |
263 | i2 = abs(NaviData.HomePosition.Longitude)%10000000L; |
263 | i2 = abs(NaviData.HomePosition.Longitude)%10000000L; |
264 | LCD_printfxy(0,1,"Lon:%c%03ld.%07ld deg",sign, i1, i2); |
264 | LCD_printfxy(0,1,"Lon:%c%03ld.%07ld deg",sign, i1, i2); |
265 | if(NaviData.HomePosition.Latitude < 0) sign = '-'; |
265 | if(NaviData.HomePosition.Latitude < 0) sign = '-'; |
266 | else sign = '+'; |
266 | else sign = '+'; |
267 | i1 = abs(NaviData.HomePosition.Latitude)/10000000L; |
267 | i1 = abs(NaviData.HomePosition.Latitude)/10000000L; |
268 | i2 = abs(NaviData.HomePosition.Latitude)%10000000L; |
268 | i2 = abs(NaviData.HomePosition.Latitude)%10000000L; |
269 | LCD_printfxy(0,2,"Lat:%c%03ld.%07ld deg",sign, i1, i2); |
269 | LCD_printfxy(0,2,"Lat:%c%03ld.%07ld deg",sign, i1, i2); |
270 | if(NaviData.HomePosition.Altitude < 0) sign = '-'; |
270 | if(NaviData.HomePosition.Altitude < 0) sign = '-'; |
271 | else sign = '+'; |
271 | else sign = '+'; |
272 | i1 = abs(NaviData.HomePosition.Altitude)/1000L; |
272 | i1 = abs(NaviData.HomePosition.Altitude)/1000L; |
273 | i2 = abs(NaviData.HomePosition.Altitude)%1000L; |
273 | i2 = abs(NaviData.HomePosition.Altitude)%1000L; |
274 | LCD_printfxy(0,3,"Alt:%c%04ld.%03ld m",sign, i1, i2); |
274 | LCD_printfxy(0,3,"Alt:%c%04ld.%03ld m",sign, i1, i2); |
275 | } |
275 | } |
276 | break; |
276 | break; |
277 | case 8: |
277 | case 8: |
278 | LCD_printfxy(0,0,"Target Position"); |
278 | LCD_printfxy(0,0,"Target Position"); |
279 | if(NaviData.TargetPosition.Status == INVALID) |
279 | if(NaviData.TargetPosition.Status == INVALID) |
280 | { |
280 | { |
281 | LCD_printfxy(0,1," "); |
281 | LCD_printfxy(0,1," "); |
282 | LCD_printfxy(0,2," Is not set. "); |
282 | LCD_printfxy(0,2," Is not set. "); |
283 | LCD_printfxy(0,3," "); |
283 | LCD_printfxy(0,3," "); |
284 | } |
284 | } |
285 | else |
285 | else |
286 | { |
286 | { |
287 | if(NaviData.TargetPosition.Longitude < 0) sign = '-'; |
287 | if(NaviData.TargetPosition.Longitude < 0) sign = '-'; |
288 | else sign = '+'; |
288 | else sign = '+'; |
289 | i1 = abs(NaviData.TargetPosition.Longitude)/10000000L; |
289 | i1 = abs(NaviData.TargetPosition.Longitude)/10000000L; |
290 | i2 = abs(NaviData.TargetPosition.Longitude)%10000000L; |
290 | i2 = abs(NaviData.TargetPosition.Longitude)%10000000L; |
291 | LCD_printfxy(0,1,"Lon:%c%03ld.%07ld deg",sign, i1, i2); |
291 | LCD_printfxy(0,1,"Lon:%c%03ld.%07ld deg",sign, i1, i2); |
292 | if(NaviData.TargetPosition.Latitude < 0) sign = '-'; |
292 | if(NaviData.TargetPosition.Latitude < 0) sign = '-'; |
293 | else sign = '+'; |
293 | else sign = '+'; |
294 | i1 = abs(NaviData.TargetPosition.Latitude)/10000000L; |
294 | i1 = abs(NaviData.TargetPosition.Latitude)/10000000L; |
295 | i2 = abs(NaviData.TargetPosition.Latitude)%10000000L; |
295 | i2 = abs(NaviData.TargetPosition.Latitude)%10000000L; |
296 | LCD_printfxy(0,2,"Lat:%c%03ld.%07ld deg",sign, i1, i2); |
296 | LCD_printfxy(0,2,"Lat:%c%03ld.%07ld deg",sign, i1, i2); |
297 | if(NaviData.HomePosition.Altitude < 0) sign = '-'; |
297 | if(NaviData.HomePosition.Altitude < 0) sign = '-'; |
298 | else sign = '+'; |
298 | else sign = '+'; |
299 | i1 = abs(NaviData.TargetPosition.Altitude)/1000L; |
299 | i1 = abs(NaviData.TargetPosition.Altitude)/1000L; |
300 | i2 = abs(NaviData.TargetPosition.Altitude)%1000L; |
300 | i2 = abs(NaviData.TargetPosition.Altitude)%1000L; |
301 | LCD_printfxy(0,3,"Alt:%c%04ld.%03ld m",sign, i1, i2); |
301 | LCD_printfxy(0,3,"Alt:%c%04ld.%03ld m",sign, i1, i2); |
302 | } |
302 | } |
303 | break; |
303 | break; |
304 | case 9: // RC stick controls from FC |
304 | case 9: // RC stick controls from FC |
305 | LCD_printfxy(0,0,"RC-Sticks" ); |
305 | LCD_printfxy(0,0,"RC-Sticks" ); |
306 | LCD_printfxy(0,1,"Ni:%4i Ro:%4i ",FC.StickNick, FC.StickRoll); |
306 | LCD_printfxy(0,1,"Ni:%4i Ro:%4i ",FC.StickNick, FC.StickRoll); |
307 | LCD_printfxy(0,2,"Gs:%4i Ya:%4i ",FC.StickGas, FC.StickYaw); |
307 | LCD_printfxy(0,2,"Gs:%4i Ya:%4i ",FC.StickGas, FC.StickYaw); |
308 | break; |
308 | break; |
309 | case 10: // RC poti controls from FC |
309 | case 10: // RC poti controls from FC |
310 | LCD_printfxy(0,0,"RC-Potis 1" ); |
310 | LCD_printfxy(0,0,"RC-Potis 1" ); |
311 | LCD_printfxy(0,1,"Po1:%3i Po2:%3i ",FC.Poti[0], FC.Poti[1]); |
311 | LCD_printfxy(0,1,"Po1:%3i Po2:%3i ",FC.Poti[0], FC.Poti[1]); |
312 | LCD_printfxy(0,2,"Po3:%3i Po4:%3i ",FC.Poti[2], FC.Poti[3]); |
312 | LCD_printfxy(0,2,"Po3:%3i Po4:%3i ",FC.Poti[2], FC.Poti[3]); |
313 | break; |
313 | break; |
314 | case 11: // RC poti controls from FC |
314 | case 11: // RC poti controls from FC |
315 | LCD_printfxy(0,0,"RC-Potis 2" ); |
315 | LCD_printfxy(0,0,"RC-Potis 2" ); |
316 | LCD_printfxy(0,1,"Po5:%3i Po6:%3i ",FC.Poti[4], FC.Poti[5]); |
316 | LCD_printfxy(0,1,"Po5:%3i Po6:%3i ",FC.Poti[4], FC.Poti[5]); |
317 | LCD_printfxy(0,2,"Po7:%3i Po8:%3i ",FC.Poti[6], FC.Poti[7]); |
317 | LCD_printfxy(0,2,"Po7:%3i Po8:%3i ",FC.Poti[6], FC.Poti[7]); |
318 | break; |
318 | break; |
319 | case 12: // attitude from FC |
319 | case 12: // attitude from FC |
320 | if(FromFlightCtrl.AngleNick < 0) sign = '-'; |
320 | if(FromFlightCtrl.AngleNick < 0) sign = '-'; |
321 | else sign = '+'; |
321 | else sign = '+'; |
322 | i1 = abs(FromFlightCtrl.AngleNick)/10; |
322 | i1 = abs(FromFlightCtrl.AngleNick)/10; |
323 | i2 = abs(FromFlightCtrl.AngleNick)%10; |
323 | i2 = abs(FromFlightCtrl.AngleNick)%10; |
324 | LCD_printfxy(0,0,"GyroNick:%c%03ld.%01ld", sign, i1, i2); |
324 | LCD_printfxy(0,0,"GyroNick:%c%03ld.%01ld", sign, i1, i2); |
325 | if(FromFlightCtrl.AngleRoll < 0) sign = '-'; |
325 | if(FromFlightCtrl.AngleRoll < 0) sign = '-'; |
326 | else sign = '+'; |
326 | else sign = '+'; |
327 | i1 = abs(FromFlightCtrl.AngleRoll)/10; |
327 | i1 = abs(FromFlightCtrl.AngleRoll)/10; |
328 | i2 = abs(FromFlightCtrl.AngleRoll)%10; |
328 | i2 = abs(FromFlightCtrl.AngleRoll)%10; |
329 | LCD_printfxy(0,1,"GyroRoll:%c%03ld.%01ld", sign, i1, i2); |
329 | LCD_printfxy(0,1,"GyroRoll:%c%03ld.%01ld", sign, i1, i2); |
330 | if(FromFlightCtrl.AccNick < 0) sign = '-'; |
330 | if(FromFlightCtrl.AccNick < 0) sign = '-'; |
331 | else sign = '+'; |
331 | else sign = '+'; |
332 | i1 = abs(FromFlightCtrl.AccNick)/10; |
332 | i1 = abs(FromFlightCtrl.AccNick)/10; |
333 | i2 = abs(FromFlightCtrl.AccNick)%10; |
333 | i2 = abs(FromFlightCtrl.AccNick)%10; |
334 | LCD_printfxy(0,2," AccNick:%c%03ld.%01ld", sign, i1, i2); |
334 | LCD_printfxy(0,2," AccNick:%c%03ld.%01ld", sign, i1, i2); |
335 | if(FromFlightCtrl.AccRoll < 0) sign = '-'; |
335 | if(FromFlightCtrl.AccRoll < 0) sign = '-'; |
336 | else sign = '+'; |
336 | else sign = '+'; |
337 | i1 = abs(FromFlightCtrl.AccRoll)/10; |
337 | i1 = abs(FromFlightCtrl.AccRoll)/10; |
338 | i2 = abs(FromFlightCtrl.AccRoll)%10; |
338 | i2 = abs(FromFlightCtrl.AccRoll)%10; |
339 | LCD_printfxy(0,3," AccRoll:%c%03ld.%01ld", sign, i1, i2); |
339 | LCD_printfxy(0,3," AccRoll:%c%03ld.%01ld", sign, i1, i2); |
340 | break; |
340 | break; |
341 | case 13: // gyros from FC |
341 | case 13: // gyros from FC |
342 | LCD_printfxy(0,0,"GyroNick: %4i", FromFlightCtrl.GyroNick); |
342 | LCD_printfxy(0,0,"GyroNick: %4i", FromFlightCtrl.GyroNick); |
343 | LCD_printfxy(0,1,"GyroRoll: %4i", FromFlightCtrl.GyroRoll); |
343 | LCD_printfxy(0,1,"GyroRoll: %4i", FromFlightCtrl.GyroRoll); |
344 | LCD_printfxy(0,2,"GyroYaw: %4i", FromFlightCtrl.GyroYaw); |
344 | LCD_printfxy(0,2,"GyroYaw: %4i", FromFlightCtrl.GyroYaw); |
345 | break; |
345 | break; |
346 | case 14: // Remote Control Level from FC |
346 | case 14: // Remote Control Level from FC |
347 | LCD_printfxy(0,0,"RC-Level: %3i", FC.RC_Quality); |
347 | LCD_printfxy(0,0,"RC-Level: %3i", FC.RC_Quality); |
348 | LCD_printfxy(0,1,"Ubat: %2i.%1i V", FC.BAT_Voltage/10, FC.BAT_Voltage%10); |
348 | LCD_printfxy(0,1,"Ubat: %2i.%1i V", FC.BAT_Voltage/10, FC.BAT_Voltage%10); |
349 | LCD_printfxy(0,2,"CompHeading: %3i", Compass_Heading); |
349 | LCD_printfxy(0,2,"CompHeading: %3i", Compass_Heading); |
350 | if(GeoMagDec < 0) sign = '-'; |
350 | if(GeoMagDec < 0) sign = '-'; |
351 | else sign = '+'; |
351 | else sign = '+'; |
352 | LCD_printfxy(0,3,"GeoMagDec: %c%i.%1i", sign, abs(GeoMagDec)/10,abs(GeoMagDec)%10); |
352 | LCD_printfxy(0,3,"GeoMagDec: %c%i.%1i", sign, abs(GeoMagDec)/10,abs(GeoMagDec)%10); |
353 | break; |
353 | break; |
354 | case 15: // User Parameter |
354 | case 15: // User Parameter |
355 | LCD_printfxy(0,0,"UP1:%3i UP2:%3i",Parameter.User1,Parameter.User2); |
355 | LCD_printfxy(0,0,"UP1:%3i UP2:%3i",Parameter.User1,Parameter.User2); |
356 | LCD_printfxy(0,1,"UP3:%3i UP4:%3i",Parameter.User3,Parameter.User4); |
356 | LCD_printfxy(0,1,"UP3:%3i UP4:%3i",Parameter.User3,Parameter.User4); |
357 | LCD_printfxy(0,2,"UP5:%3i UP6:%3i",Parameter.User5,Parameter.User6); |
357 | LCD_printfxy(0,2,"UP5:%3i UP6:%3i",Parameter.User5,Parameter.User6); |
358 | LCD_printfxy(0,3,"UP7:%3i UP8:%3i",Parameter.User7,Parameter.User8); |
358 | LCD_printfxy(0,3,"UP7:%3i UP8:%3i",Parameter.User7,Parameter.User8); |
359 | break; |
359 | break; |
360 | case 16: // magnetic field |
360 | case 16: // magnetic field |
361 | if(Compass_CalState) |
361 | if(Compass_CalState) |
362 | { |
362 | { |
363 | LCD_printfxy(0,0,"Calibration:"); |
363 | LCD_printfxy(0,0,"Calibration:"); |
364 | LCD_printfxy(0,1,"Step %d/", Compass_CalState); |
364 | LCD_printfxy(0,1,"Step %d/", Compass_CalState); |
365 | LCD_printfxy(0,2,"X %4i Y %4i Z %4i",MagVector.X,MagVector.Y,MagVector.Z); |
365 | LCD_printfxy(0,2,"X %4i Y %4i Z %4i",MagVector.X,MagVector.Y,MagVector.Z); |
366 | LCD_printfxy(9,3,"(ESC)(NEXT)"); |
366 | LCD_printfxy(9,3,"(ESC)(NEXT)"); |
367 | switch(Compass_CalState) |
367 | switch(Compass_CalState) |
368 | { |
368 | { |
369 | case 1: |
369 | case 1: |
370 | case 3: |
370 | case 3: |
371 | LCD_printfxy(7,1,"pause"); |
371 | LCD_printfxy(7,1,"pause"); |
372 | break; |
372 | break; |
373 | 373 | ||
374 | case 2: |
374 | case 2: |
375 | LCD_printfxy(7,1,"horizontal"); |
375 | LCD_printfxy(7,1,"horizontal"); |
376 | break; |
376 | break; |
377 | 377 | ||
378 | case 4: |
378 | case 4: |
379 | LCD_printfxy(7,1,"vertical"); |
379 | LCD_printfxy(7,1,"vertical"); |
380 | break; |
380 | break; |
381 | 381 | ||
382 | case 5: |
382 | case 5: |
383 | LCD_printfxy(7,1,"data saved"); |
383 | LCD_printfxy(7,1,"data saved"); |
384 | LCD_printfxy(8,3," (END) "); |
384 | LCD_printfxy(8,3," (END) "); |
385 | break; |
385 | break; |
386 | 386 | ||
387 | default: |
387 | default: |
388 | break; |
388 | break; |
389 | } |
389 | } |
390 | } |
390 | } |
391 | else |
391 | else |
392 | { |
392 | { |
393 | LCD_printfxy(0,0,"Magnetic Field"); |
393 | LCD_printfxy(0,0,"Magnetic Field"); |
394 | LCD_printfxy(0,1,"X:%5i",MagVector.X); |
394 | LCD_printfxy(0,1,"X:%5i",MagVector.X); |
395 | LCD_printfxy(0,2,"Y:%5i",MagVector.Y); |
395 | LCD_printfxy(0,2,"Y:%5i",MagVector.Y); |
396 | LCD_printfxy(0,3,"Z:%5i",MagVector.Z); |
396 | LCD_printfxy(0,3,"Z:%5i",MagVector.Z); |
397 | LCD_printfxy(15,3,"(CAL)"); |
397 | LCD_printfxy(15,3,"(CAL)"); |
398 | } |
398 | } |
399 | if(Keys & KEY4) // next step |
399 | if(Keys & KEY4) // next step |
400 | { |
400 | { |
401 | if(Compass_CalState <5) Compass_SetCalState(Compass_CalState+1); |
401 | if(Compass_CalState <5) Compass_SetCalState(Compass_CalState+1); |
402 | else Compass_SetCalState(0); |
402 | else Compass_SetCalState(0); |
403 | } |
403 | } |
404 | if(Keys & KEY3)Compass_SetCalState(0); // cancel |
404 | if(Keys & KEY3)Compass_SetCalState(0); // cancel |
405 | break; |
405 | break; |
406 | default: |
406 | default: |
407 | //MaxMenuItem = MenuItem - 1; |
407 | //MaxMenuItem = MenuItem - 1; |
408 | MenuItem = 0; |
408 | MenuItem = 0; |
409 | break; |
409 | break; |
410 | } |
410 | } |
411 | } |
411 | } |
412 | 412 |