Rev 471 | Rev 473 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 471 | Rev 472 | ||
---|---|---|---|
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 | #include "logging.h" |
69 | #include "logging.h" |
70 | #include "settings.h" |
70 | #include "settings.h" |
71 | #include "gpx.h" |
71 | #include "gpx.h" |
72 | 72 | ||
73 | u8 DispPtr = 0; |
73 | u8 DispPtr = 0; |
74 | s8 DisplayBuff[DISPLAYBUFFSIZE]; |
74 | s8 DisplayBuff[DISPLAYBUFFSIZE]; |
75 | 75 | ||
76 | 76 | ||
77 | u8 MenuItem = 0; |
77 | u8 MenuItem = 0; |
78 | u8 MaxMenuItem = 22; |
78 | u8 MaxMenuItem = 22; |
79 | 79 | ||
80 | void Menu_Putchar(char c) |
80 | void Menu_Putchar(char c) |
81 | { |
81 | { |
82 | if(DispPtr < DISPLAYBUFFSIZE) DisplayBuff[DispPtr++] = c; ; |
82 | if(DispPtr < DISPLAYBUFFSIZE) DisplayBuff[DispPtr++] = c; ; |
83 | } |
83 | } |
84 | 84 | ||
85 | void Menu_Clear(void) |
85 | void Menu_Clear(void) |
86 | { |
86 | { |
87 | u8 i; |
87 | u8 i; |
88 | for( i = 0; i < DISPLAYBUFFSIZE; i++) DisplayBuff[i] = ' '; |
88 | for( i = 0; i < DISPLAYBUFFSIZE; i++) DisplayBuff[i] = ' '; |
89 | } |
89 | } |
90 | 90 | ||
91 | 91 | ||
92 | // Display with 20 characters in 4 lines |
92 | // Display with 20 characters in 4 lines |
93 | void Menu_Update(u8 Keys) |
93 | void Menu_Update(u8 Keys) |
94 | { |
94 | { |
95 | s32 i1,i2; |
95 | s32 i1,i2; |
96 | u8 sign; |
96 | u8 sign; |
97 | 97 | ||
98 | if(Keys & KEY1) { if(MenuItem > 0) MenuItem--; else MenuItem = MaxMenuItem;} |
98 | if(Keys & KEY1) { if(MenuItem > 0) MenuItem--; else MenuItem = MaxMenuItem;} |
99 | if(Keys & KEY2) { if(MenuItem == MaxMenuItem) MenuItem = 0; else MenuItem++;} |
99 | if(Keys & KEY2) { if(MenuItem == MaxMenuItem) MenuItem = 0; else MenuItem++;} |
100 | if((Keys & KEY1) && (Keys & KEY2)) MenuItem = 0; |
100 | if((Keys & KEY1) && (Keys & KEY2)) MenuItem = 0; |
101 | if(MenuItem > MaxMenuItem) MenuItem = MaxMenuItem; |
101 | if(MenuItem > MaxMenuItem) MenuItem = MaxMenuItem; |
102 | Menu_Clear(); |
102 | Menu_Clear(); |
103 | // print menu item number in the upper right corner |
103 | // print menu item number in the upper right corner |
104 | if(MenuItem < 10) |
104 | if(MenuItem < 10) |
105 | { |
105 | { |
106 | LCD_printfxy(17,0,"[%i]",MenuItem); |
106 | LCD_printfxy(17,0,"[%i]",MenuItem); |
107 | } |
107 | } |
108 | else // Menuitem >= 10 |
108 | else // Menuitem >= 10 |
109 | { |
109 | { |
110 | LCD_printfxy(16,0,"[%i]",MenuItem); |
110 | LCD_printfxy(16,0,"[%i]",MenuItem); |
111 | } |
111 | } |
112 | 112 | ||
113 | switch(MenuItem) |
113 | switch(MenuItem) |
114 | { |
114 | { |
115 | // Version Info |
115 | // Version Info |
116 | case 0: |
116 | case 0: |
117 | LCD_printfxy(0,0,"++ Navi-Ctrl ++"); |
117 | LCD_printfxy(0,0,"++ Navi-Ctrl ++"); |
118 | LCD_printfxy(0,1,"HW V%d.%d SW V%d.%02d%c", Version_HW/10, Version_HW%10, VERSION_MAJOR, VERSION_MINOR, 'a'+ VERSION_PATCH); |
118 | LCD_printfxy(0,1,"HW V%d.%d SW V%d.%02d%c", Version_HW/10, Version_HW%10, VERSION_MAJOR, VERSION_MINOR, 'a'+ VERSION_PATCH); |
119 | 119 | ||
120 | if(ErrorCode) |
120 | if(ErrorCode) |
121 | { |
121 | { |
122 | LCD_printfxy(0,2,"Error: %d",ErrorCode); |
122 | LCD_printfxy(0,2,"Error: %d",ErrorCode); |
123 | LCD_printfxy(0,3,"%s",ErrorMSG); |
123 | LCD_printfxy(0,3,"%s",ErrorMSG); |
124 | } |
124 | } |
125 | else |
125 | else |
126 | { |
126 | { |
127 | LCD_printfxy(0,3,"(c) HiSystems GmbH"); |
127 | LCD_printfxy(0,3,"(c) HiSystems GmbH"); |
128 | LCD_printfxy(0,2,"%s",ErrorMSG); |
128 | LCD_printfxy(0,2,"%s",ErrorMSG); |
129 | } |
129 | } |
130 | break; |
130 | break; |
131 | case 1: |
131 | case 1: |
132 | if (GPSData.Status == INVALID) |
132 | if (GPSData.Status == INVALID) |
133 | { |
133 | { |
134 | LCD_printfxy(0,0,"No GPS data"); |
134 | LCD_printfxy(0,0,"No GPS data"); |
135 | LCD_printfxy(0,1,"Lon: "); |
135 | LCD_printfxy(0,1,"Lon: "); |
136 | LCD_printfxy(0,2,"Lat: "); |
136 | LCD_printfxy(0,2,"Lat: "); |
137 | LCD_printfxy(0,3,"Alt: "); |
137 | LCD_printfxy(0,3,"Alt: "); |
138 | } |
138 | } |
139 | else // newdata or processed |
139 | else // newdata or processed |
140 | { |
140 | { |
141 | LCD_printfxy(0,0,"Sat:%02d ", GPSData.NumOfSats); |
141 | LCD_printfxy(0,0,"Sat:%02d ", GPSData.NumOfSats); |
142 | switch (GPSData.SatFix) |
142 | switch (GPSData.SatFix) |
143 | { |
143 | { |
144 | case SATFIX_NONE: |
144 | case SATFIX_NONE: |
145 | LCD_printfxy(7,0,"NoFix"); |
145 | LCD_printfxy(7,0,"NoFix"); |
146 | break; |
146 | break; |
147 | case SATFIX_2D: |
147 | case SATFIX_2D: |
148 | LCD_printfxy(7,0,"2DFix"); |
148 | LCD_printfxy(7,0,"2DFix"); |
149 | break; |
149 | break; |
150 | case SATFIX_3D: |
150 | case SATFIX_3D: |
151 | LCD_printfxy(7,0,"3DFix"); |
151 | LCD_printfxy(7,0,"3DFix"); |
152 | break; |
152 | break; |
153 | default: |
153 | default: |
154 | LCD_printfxy(7,0,"??Fix"); |
154 | LCD_printfxy(7,0,"??Fix"); |
155 | break; |
155 | break; |
156 | } |
156 | } |
157 | if(GPSData.Flags & FLAG_DIFFSOLN) |
157 | if(GPSData.Flags & FLAG_DIFFSOLN) |
158 | { |
158 | { |
159 | LCD_printfxy(12,0,"/DGPS"); |
159 | LCD_printfxy(12,0,"/DGPS"); |
160 | } |
160 | } |
161 | else |
161 | else |
162 | { |
162 | { |
163 | LCD_printfxy(12,0," "); |
163 | LCD_printfxy(12,0," "); |
164 | } |
164 | } |
165 | 165 | ||
166 | if(GPSData.Position.Longitude < 0) sign = '-'; |
166 | if(GPSData.Position.Longitude < 0) sign = '-'; |
167 | else sign = '+'; |
167 | else sign = '+'; |
168 | i1 = abs(GPSData.Position.Longitude)/10000000L; |
168 | i1 = abs(GPSData.Position.Longitude)/10000000L; |
169 | i2 = abs(GPSData.Position.Longitude)%10000000L; |
169 | i2 = abs(GPSData.Position.Longitude)%10000000L; |
170 | LCD_printfxy(0,1,"Lon:%c%03ld.%07ld deg",sign, i1, i2); |
170 | LCD_printfxy(0,1,"Lon:%c%03ld.%07ld deg",sign, i1, i2); |
171 | if(GPSData.Position.Latitude < 0) sign = '-'; |
171 | if(GPSData.Position.Latitude < 0) sign = '-'; |
172 | else sign = '+'; |
172 | else sign = '+'; |
173 | i1 = abs(GPSData.Position.Latitude)/10000000L; |
173 | i1 = abs(GPSData.Position.Latitude)/10000000L; |
174 | i2 = abs(GPSData.Position.Latitude)%10000000L; |
174 | i2 = abs(GPSData.Position.Latitude)%10000000L; |
175 | LCD_printfxy(0,2,"Lat:%c%03ld.%07ld deg",sign, i1, i2); |
175 | LCD_printfxy(0,2,"Lat:%c%03ld.%07ld deg",sign, i1, i2); |
176 | if(GPSData.Position.Altitude < 0) sign = '-'; |
176 | if(GPSData.Position.Altitude < 0) sign = '-'; |
177 | else sign = '+'; |
177 | else sign = '+'; |
178 | i1 = abs(GPSData.Position.Altitude)/1000L; |
178 | i1 = abs(GPSData.Position.Altitude)/1000L; |
179 | i2 = abs(GPSData.Position.Altitude)%1000L; |
179 | i2 = abs(GPSData.Position.Altitude)%1000L; |
180 | LCD_printfxy(0,3,"Alt:%c%04ld.%03ld m", sign, i1, i2); |
180 | LCD_printfxy(0,3,"Alt:%c%04ld.%03ld m", sign, i1, i2); |
181 | } |
181 | } |
182 | break; |
182 | break; |
183 | case 2: |
183 | case 2: |
184 | if (GPSData.Status == INVALID) |
184 | if (GPSData.Status == INVALID) |
185 | { |
185 | { |
186 | LCD_printfxy(0,0,"No GPS data"); |
186 | LCD_printfxy(0,0,"No GPS data"); |
187 | LCD_printfxy(0,1,"Speed N: "); |
187 | LCD_printfxy(0,1,"Speed N: "); |
188 | LCD_printfxy(0,2,"Speed E: "); |
188 | LCD_printfxy(0,2,"Speed E: "); |
189 | LCD_printfxy(0,3,"Speed T: "); |
189 | LCD_printfxy(0,3,"Speed T: "); |
190 | } |
190 | } |
191 | else // newdata or processed |
191 | else // newdata or processed |
192 | { |
192 | { |
193 | LCD_printfxy(0,0,"Sat:%02d ", GPSData.NumOfSats); |
193 | LCD_printfxy(0,0,"Sat:%02d ", GPSData.NumOfSats); |
194 | switch (GPSData.SatFix) |
194 | switch (GPSData.SatFix) |
195 | { |
195 | { |
196 | case SATFIX_NONE: |
196 | case SATFIX_NONE: |
197 | LCD_printfxy(7,0,"NoFix"); |
197 | LCD_printfxy(7,0,"NoFix"); |
198 | break; |
198 | break; |
199 | case SATFIX_2D: |
199 | case SATFIX_2D: |
200 | LCD_printfxy(7,0,"2DFix"); |
200 | LCD_printfxy(7,0,"2DFix"); |
201 | break; |
201 | break; |
202 | case SATFIX_3D: |
202 | case SATFIX_3D: |
203 | LCD_printfxy(7,0,"3DFix"); |
203 | LCD_printfxy(7,0,"3DFix"); |
204 | break; |
204 | break; |
205 | default: |
205 | default: |
206 | LCD_printfxy(7,0,"??Fix"); |
206 | LCD_printfxy(7,0,"??Fix"); |
207 | break; |
207 | break; |
208 | } |
208 | } |
209 | if(GPSData.Flags & FLAG_DIFFSOLN) |
209 | if(GPSData.Flags & FLAG_DIFFSOLN) |
210 | { |
210 | { |
211 | LCD_printfxy(12,0,"/DGPS"); |
211 | LCD_printfxy(12,0,"/DGPS"); |
212 | } |
212 | } |
213 | else |
213 | else |
214 | { |
214 | { |
215 | LCD_printfxy(12,0," "); |
215 | LCD_printfxy(12,0," "); |
216 | } |
216 | } |
217 | 217 | ||
218 | LCD_printfxy(0,1,"Speed N: %+4ld cm/s",GPSData.Speed_North); |
218 | LCD_printfxy(0,1,"Speed N: %+4ld cm/s",GPSData.Speed_North); |
219 | LCD_printfxy(0,2,"Speed E: %+4ld cm/s",GPSData.Speed_East); |
219 | LCD_printfxy(0,2,"Speed E: %+4ld cm/s",GPSData.Speed_East); |
220 | LCD_printfxy(0,3,"Speed T: %+4ld cm/s",GPSData.Speed_Top); |
220 | LCD_printfxy(0,3,"Speed T: %+4ld cm/s",GPSData.Speed_Top); |
221 | } |
221 | } |
222 | break; |
222 | break; |
223 | case 3: |
223 | case 3: |
224 | LCD_printfxy(0,0,"GPS UTC Time"); |
224 | LCD_printfxy(0,0,"GPS UTC Time"); |
225 | if (!SystemTime.Valid) |
225 | if (!SystemTime.Valid) |
226 | { |
226 | { |
227 | LCD_printfxy(0,1," "); |
227 | LCD_printfxy(0,1," "); |
228 | LCD_printfxy(0,2," No time data! "); |
228 | LCD_printfxy(0,2," No time data! "); |
229 | LCD_printfxy(0,3," "); |
229 | LCD_printfxy(0,3," "); |
230 | } |
230 | } |
231 | else // newdata or processed |
231 | else // newdata or processed |
232 | { |
232 | { |
233 | LCD_printfxy(0,1," "); |
233 | LCD_printfxy(0,1," "); |
234 | LCD_printfxy(0,2,"Date: %02i/%02i/%04i",SystemTime.Month, SystemTime.Day, SystemTime.Year); |
234 | LCD_printfxy(0,2,"Date: %02i/%02i/%04i",SystemTime.Month, SystemTime.Day, SystemTime.Year); |
235 | LCD_printfxy(0,3,"Time: %02i:%02i:%02i.%03i", SystemTime.Hour, SystemTime.Min, SystemTime.Sec, SystemTime.mSec); |
235 | LCD_printfxy(0,3,"Time: %02i:%02i:%02i.%03i", SystemTime.Hour, SystemTime.Min, SystemTime.Sec, SystemTime.mSec); |
236 | } |
236 | } |
237 | break; |
237 | break; |
238 | case 4: // Navi Params 1 from FC |
238 | case 4: // Navi Params 1 from FC |
239 | LCD_printfxy(0,0,"NaviMode: %3i" , Parameter.NaviGpsModeControl); |
239 | LCD_printfxy(0,0,"NaviMode: %3i" , Parameter.NaviGpsModeControl); |
240 | LCD_printfxy(0,1,"G :%3i P :%3i ",Parameter.NaviGpsGain, Parameter.NaviGpsP); |
240 | LCD_printfxy(0,1,"G :%3i P :%3i ",Parameter.NaviGpsGain, Parameter.NaviGpsP); |
241 | LCD_printfxy(0,2,"I :%3i D :%3i ",Parameter.NaviGpsI, Parameter.NaviGpsD); |
241 | LCD_printfxy(0,2,"I :%3i D :%3i ",Parameter.NaviGpsI, Parameter.NaviGpsD); |
242 | LCD_printfxy(0,3,"ACC:%3i SAT:%3i ",Parameter.NaviGpsACC, Parameter.NaviGpsMinSat); |
242 | LCD_printfxy(0,3,"ACC:%3i SAT:%3i ",Parameter.NaviGpsACC, Parameter.NaviGpsMinSat); |
243 | break; |
243 | break; |
244 | case 5: // Navi Params 2 from FC |
244 | case 5: // Navi Params 2 from FC |
245 | LCD_printfxy(0,0,"Stick TS: %3i", Parameter.NaviStickThreshold); |
245 | LCD_printfxy(0,0,"Stick TS: %3i", Parameter.NaviStickThreshold); |
246 | LCD_printfxy(0,1,"MaxRadius: %3im", DebugOut.Analog[4]); |
246 | LCD_printfxy(0,1,"MaxRadius: %3im", DebugOut.Analog[4]); |
247 | LCD_printfxy(0,2,"WindCorr: %3i", Parameter.NaviWindCorrection); |
247 | LCD_printfxy(0,2,"WindCorr: %3i", Parameter.NaviWindCorrection); |
248 | LCD_printfxy(0,3,"AccComp: %3i", Parameter.NaviSpeedCompensation); |
248 | LCD_printfxy(0,3,"AccComp: %3i", Parameter.NaviSpeedCompensation); |
249 | break; |
249 | break; |
250 | case 6: // Navi Params 3 from FC |
250 | case 6: // Navi Params 3 from FC |
251 | LCD_printfxy(0,0,"Angle-Limit: %3i", Parameter.NaviAngleLimitation); |
251 | LCD_printfxy(0,0,"Angle-Limit: %3i", Parameter.NaviAngleLimitation); |
252 | LCD_printfxy(0,1," P-Limit: %3i", Parameter.NaviGpsPLimit); |
252 | LCD_printfxy(0,1," P-Limit: %3i", Parameter.NaviGpsPLimit); |
253 | LCD_printfxy(0,2," I-Limit: %3i", Parameter.NaviGpsILimit); |
253 | LCD_printfxy(0,2," I-Limit: %3i", Parameter.NaviGpsILimit); |
254 | LCD_printfxy(0,3," D-Limit: %3i", Parameter.NaviGpsDLimit); |
254 | LCD_printfxy(0,3," D-Limit: %3i", Parameter.NaviGpsDLimit); |
255 | break; |
255 | break; |
256 | case 7: // Max Ranges |
256 | case 7: // Max Ranges |
257 | LCD_printfxy(0,0,"Maximum flying "); |
257 | LCD_printfxy(0,0,"Maximum flying "); |
258 | LCD_printfxy(0,1,"Range: %4im ", AbsoluteFlyingRange); |
258 | LCD_printfxy(0,1,"Range: %4im ", AbsoluteFlyingRange); |
259 | LCD_printfxy(0,2,"Descend: %4im ", AutoDescendRange); |
259 | LCD_printfxy(0,2,"Descend: %4im ", AutoDescendRange); |
260 | LCD_printfxy(0,3,"Altitude:%4im ", AbsoluteFlyingAltitude); |
260 | LCD_printfxy(0,3,"Altitude:%4im ", AbsoluteFlyingAltitude); |
261 | if(!AbsoluteFlyingRange) LCD_printfxy(9,1,"disabled"); |
261 | if(!AbsoluteFlyingRange) LCD_printfxy(9,1,"disabled"); |
262 | if(!AutoDescendRange) LCD_printfxy(9,2,"disabled"); |
262 | if(!AutoDescendRange) LCD_printfxy(9,2,"disabled"); |
263 | if(!AbsoluteFlyingAltitude) LCD_printfxy(9,3,"disabled"); |
263 | if(!AbsoluteFlyingAltitude) LCD_printfxy(9,3,"disabled"); |
264 | break; |
264 | break; |
265 | case 8: |
265 | case 8: |
266 | LCD_printfxy(0,0,"Home Position"); |
266 | LCD_printfxy(0,0,"Home Position"); |
267 | if(NaviData.HomePosition.Status == INVALID) |
267 | if(NaviData.HomePosition.Status == INVALID) |
268 | { |
268 | { |
269 | LCD_printfxy(0,1," "); |
269 | LCD_printfxy(0,1," "); |
270 | LCD_printfxy(0,2," Is not set. "); |
270 | LCD_printfxy(0,2," Is not set. "); |
271 | LCD_printfxy(0,3," "); |
271 | LCD_printfxy(0,3," "); |
272 | } |
272 | } |
273 | else |
273 | else |
274 | { |
274 | { |
275 | if(NaviData.HomePosition.Longitude < 0) sign = '-'; |
275 | if(NaviData.HomePosition.Longitude < 0) sign = '-'; |
276 | else sign = '+'; |
276 | else sign = '+'; |
277 | i1 = abs(NaviData.HomePosition.Longitude)/10000000L; |
277 | i1 = abs(NaviData.HomePosition.Longitude)/10000000L; |
278 | i2 = abs(NaviData.HomePosition.Longitude)%10000000L; |
278 | i2 = abs(NaviData.HomePosition.Longitude)%10000000L; |
279 | LCD_printfxy(0,1,"Lon:%c%03ld.%07ld deg",sign, i1, i2); |
279 | LCD_printfxy(0,1,"Lon:%c%03ld.%07ld deg",sign, i1, i2); |
280 | if(NaviData.HomePosition.Latitude < 0) sign = '-'; |
280 | if(NaviData.HomePosition.Latitude < 0) sign = '-'; |
281 | else sign = '+'; |
281 | else sign = '+'; |
282 | i1 = abs(NaviData.HomePosition.Latitude)/10000000L; |
282 | i1 = abs(NaviData.HomePosition.Latitude)/10000000L; |
283 | i2 = abs(NaviData.HomePosition.Latitude)%10000000L; |
283 | i2 = abs(NaviData.HomePosition.Latitude)%10000000L; |
284 | LCD_printfxy(0,2,"Lat:%c%03ld.%07ld deg",sign, i1, i2); |
284 | LCD_printfxy(0,2,"Lat:%c%03ld.%07ld deg",sign, i1, i2); |
285 | if(NaviData.HomePosition.Altitude < 0) sign = '-'; |
285 | if(NaviData.HomePosition.Altitude < 0) sign = '-'; |
286 | else sign = '+'; |
286 | else sign = '+'; |
287 | i1 = abs(NaviData.HomePosition.Altitude)/1000L; |
287 | i1 = abs(NaviData.HomePosition.Altitude)/1000L; |
288 | i2 = abs(NaviData.HomePosition.Altitude)%1000L; |
288 | i2 = abs(NaviData.HomePosition.Altitude)%1000L; |
289 | LCD_printfxy(0,3,"Alt:%c%04ld.%03ld m",sign, i1, i2); |
289 | LCD_printfxy(0,3,"Alt:%c%04ld.%03ld m",sign, i1, i2); |
290 | } |
290 | } |
291 | break; |
291 | break; |
292 | case 9: |
292 | case 9: |
293 | LCD_printfxy(0,0,"Target Position"); |
293 | LCD_printfxy(0,0,"Target Position"); |
294 | if(NaviData.TargetPosition.Status == INVALID) |
294 | if(NaviData.TargetPosition.Status == INVALID) |
295 | { |
295 | { |
296 | LCD_printfxy(0,1," "); |
296 | LCD_printfxy(0,1," "); |
297 | LCD_printfxy(0,2," Is not set. "); |
297 | LCD_printfxy(0,2," Is not set. "); |
298 | LCD_printfxy(0,3," "); |
298 | LCD_printfxy(0,3," "); |
299 | } |
299 | } |
300 | else |
300 | else |
301 | { |
301 | { |
302 | if(NaviData.TargetPosition.Longitude < 0) sign = '-'; |
302 | if(NaviData.TargetPosition.Longitude < 0) sign = '-'; |
303 | else sign = '+'; |
303 | else sign = '+'; |
304 | i1 = abs(NaviData.TargetPosition.Longitude)/10000000L; |
304 | i1 = abs(NaviData.TargetPosition.Longitude)/10000000L; |
305 | i2 = abs(NaviData.TargetPosition.Longitude)%10000000L; |
305 | i2 = abs(NaviData.TargetPosition.Longitude)%10000000L; |
306 | LCD_printfxy(0,1,"Lon:%c%03ld.%07ld deg",sign, i1, i2); |
306 | LCD_printfxy(0,1,"Lon:%c%03ld.%07ld deg",sign, i1, i2); |
307 | if(NaviData.TargetPosition.Latitude < 0) sign = '-'; |
307 | if(NaviData.TargetPosition.Latitude < 0) sign = '-'; |
308 | else sign = '+'; |
308 | else sign = '+'; |
309 | i1 = abs(NaviData.TargetPosition.Latitude)/10000000L; |
309 | i1 = abs(NaviData.TargetPosition.Latitude)/10000000L; |
310 | i2 = abs(NaviData.TargetPosition.Latitude)%10000000L; |
310 | i2 = abs(NaviData.TargetPosition.Latitude)%10000000L; |
311 | LCD_printfxy(0,2,"Lat:%c%03ld.%07ld deg",sign, i1, i2); |
311 | LCD_printfxy(0,2,"Lat:%c%03ld.%07ld deg",sign, i1, i2); |
312 | if(NaviData.HomePosition.Altitude < 0) sign = '-'; |
312 | if(NaviData.HomePosition.Altitude < 0) sign = '-'; |
313 | else sign = '+'; |
313 | else sign = '+'; |
314 | i1 = abs(NaviData.TargetPosition.Altitude)/1000L; |
314 | i1 = abs(NaviData.TargetPosition.Altitude)/1000L; |
315 | i2 = abs(NaviData.TargetPosition.Altitude)%1000L; |
315 | i2 = abs(NaviData.TargetPosition.Altitude)%1000L; |
316 | LCD_printfxy(0,3,"Alt:%c%04ld.%03ld m",sign, i1, i2); |
316 | LCD_printfxy(0,3,"Alt:%c%04ld.%03ld m",sign, i1, i2); |
317 | } |
317 | } |
318 | break; |
318 | break; |
319 | case 10: // RC stick controls from FC |
319 | case 10: // RC stick controls from FC |
320 | LCD_printfxy(0,0,"RC-Sticks" ); |
320 | LCD_printfxy(0,0,"RC-Sticks" ); |
321 | LCD_printfxy(0,1,"Ni:%4i Ro:%4i ",FC.StickNick, FC.StickRoll); |
321 | LCD_printfxy(0,1,"Ni:%4i Ro:%4i ",FC.StickNick, FC.StickRoll); |
322 | LCD_printfxy(0,2,"Gs:%4i Ya:%4i ",FC.StickGas, FC.StickYaw); |
322 | LCD_printfxy(0,2,"Gs:%4i Ya:%4i ",FC.StickGas, FC.StickYaw); |
323 | LCD_printfxy(0,3,"RC-Level: %3i", FC.RC_Quality); // Remote Control Level from FC |
323 | LCD_printfxy(0,3,"RC-Level: %3i", FC.RC_Quality); // Remote Control Level from FC |
324 | break; |
324 | break; |
325 | case 11: // RC poti controls from FC |
325 | case 11: // RC poti controls from FC |
326 | LCD_printfxy(0,0,"RC-Potis 1" ); |
326 | LCD_printfxy(0,0,"RC-Potis 1" ); |
327 | LCD_printfxy(0,1,"Po1:%3i Po2:%3i ",FC.Poti[0], FC.Poti[1]); |
327 | LCD_printfxy(0,1,"Po1:%3i Po2:%3i ",FC.Poti[0], FC.Poti[1]); |
328 | LCD_printfxy(0,2,"Po3:%3i Po4:%3i ",FC.Poti[2], FC.Poti[3]); |
328 | LCD_printfxy(0,2,"Po3:%3i Po4:%3i ",FC.Poti[2], FC.Poti[3]); |
329 | break; |
329 | break; |
330 | case 12: // RC poti controls from FC |
330 | case 12: // RC poti controls from FC |
331 | LCD_printfxy(0,0,"RC-Potis 2" ); |
331 | LCD_printfxy(0,0,"RC-Potis 2" ); |
332 | LCD_printfxy(0,1,"Po5:%3i Po6:%3i ",FC.Poti[4], FC.Poti[5]); |
332 | LCD_printfxy(0,1,"Po5:%3i Po6:%3i ",FC.Poti[4], FC.Poti[5]); |
333 | LCD_printfxy(0,2,"Po7:%3i Po8:%3i ",FC.Poti[6], FC.Poti[7]); |
333 | LCD_printfxy(0,2,"Po7:%3i Po8:%3i ",FC.Poti[6], FC.Poti[7]); |
334 | break; |
334 | break; |
335 | case 13: // attitude from FC |
335 | case 13: // attitude from FC |
336 | if(FromFlightCtrl.AngleNick < 0) sign = '-'; |
336 | if(FromFlightCtrl.AngleNick < 0) sign = '-'; |
337 | else sign = '+'; |
337 | else sign = '+'; |
338 | i1 = abs(FromFlightCtrl.AngleNick)/10; |
338 | i1 = abs(FromFlightCtrl.AngleNick)/10; |
339 | i2 = abs(FromFlightCtrl.AngleNick)%10; |
339 | i2 = abs(FromFlightCtrl.AngleNick)%10; |
340 | LCD_printfxy(0,0,"GyroNick:%c%03ld.%01ld", sign, i1, i2); |
340 | LCD_printfxy(0,0,"GyroNick:%c%03ld.%01ld", sign, i1, i2); |
341 | if(FromFlightCtrl.AngleRoll < 0) sign = '-'; |
341 | if(FromFlightCtrl.AngleRoll < 0) sign = '-'; |
342 | else sign = '+'; |
342 | else sign = '+'; |
343 | i1 = abs(FromFlightCtrl.AngleRoll)/10; |
343 | i1 = abs(FromFlightCtrl.AngleRoll)/10; |
344 | i2 = abs(FromFlightCtrl.AngleRoll)%10; |
344 | i2 = abs(FromFlightCtrl.AngleRoll)%10; |
345 | LCD_printfxy(0,1,"GyroRoll:%c%03ld.%01ld", sign, i1, i2); |
345 | LCD_printfxy(0,1,"GyroRoll:%c%03ld.%01ld", sign, i1, i2); |
346 | if(FromFlightCtrl.AccNick < 0) sign = '-'; |
346 | if(FromFlightCtrl.AccNick < 0) sign = '-'; |
347 | else sign = '+'; |
347 | else sign = '+'; |
348 | i1 = abs(FromFlightCtrl.AccNick)/10; |
348 | i1 = abs(FromFlightCtrl.AccNick)/10; |
349 | i2 = abs(FromFlightCtrl.AccNick)%10; |
349 | i2 = abs(FromFlightCtrl.AccNick)%10; |
350 | LCD_printfxy(0,2," AccNick:%c%03ld.%01ld", sign, i1, i2); |
350 | LCD_printfxy(0,2," AccNick:%c%03ld.%01ld", sign, i1, i2); |
351 | if(FromFlightCtrl.AccRoll < 0) sign = '-'; |
351 | if(FromFlightCtrl.AccRoll < 0) sign = '-'; |
352 | else sign = '+'; |
352 | else sign = '+'; |
353 | i1 = abs(FromFlightCtrl.AccRoll)/10; |
353 | i1 = abs(FromFlightCtrl.AccRoll)/10; |
354 | i2 = abs(FromFlightCtrl.AccRoll)%10; |
354 | i2 = abs(FromFlightCtrl.AccRoll)%10; |
355 | LCD_printfxy(0,3," AccRoll:%c%03ld.%01ld", sign, i1, i2); |
355 | LCD_printfxy(0,3," AccRoll:%c%03ld.%01ld", sign, i1, i2); |
356 | break; |
356 | break; |
357 | case 14: // gyros from FC |
357 | case 14: // gyros from FC |
358 | LCD_printfxy(0,0,"GyroNick: %4i", FromFlightCtrl.GyroNick); |
358 | LCD_printfxy(0,0,"GyroNick: %4i", FromFlightCtrl.GyroNick); |
359 | LCD_printfxy(0,1,"GyroRoll: %4i", FromFlightCtrl.GyroRoll); |
359 | LCD_printfxy(0,1,"GyroRoll: %4i", FromFlightCtrl.GyroRoll); |
360 | LCD_printfxy(0,2,"GyroYaw: %4i", FromFlightCtrl.GyroYaw); |
360 | LCD_printfxy(0,2,"GyroYaw: %4i", FromFlightCtrl.GyroYaw); |
361 | break; |
361 | break; |
362 | case 15: |
362 | case 15: |
363 | LCD_printfxy(0,0,"Ubat: %2i.%1i V", FC.BAT_Voltage/10, FC.BAT_Voltage%10); |
363 | LCD_printfxy(0,0,"Ubat: %2i.%1i V", FC.BAT_Voltage/10, FC.BAT_Voltage%10); |
364 | LCD_printfxy(0,1,"Compass: %3i", Compass_Heading); |
364 | LCD_printfxy(0,1,"Compass: %3i", Compass_Heading); |
365 | if(GeoMagDec < 0) sign = '-'; |
365 | if(GeoMagDec < 0) sign = '-'; |
366 | else sign = '+'; |
366 | else sign = '+'; |
367 | LCD_printfxy(0,2,"Mag.Declinat.:%c%i.%1i", sign, abs(GeoMagDec)/10,abs(GeoMagDec)%10); |
367 | LCD_printfxy(0,2,"Mag.Declinat.:%c%i.%1i", sign, abs(GeoMagDec)/10,abs(GeoMagDec)%10); |
368 | LCD_printfxy(0,3,"True Compass: %3i", GyroCompassCorrected/10); |
368 | LCD_printfxy(0,3,"True Compass: %3i", GyroCompassCorrected/10); |
369 | break; |
369 | break; |
370 | case 16: // User Parameter |
370 | case 16: // User Parameter |
371 | LCD_printfxy(0,0,"UP1:%3i UP2:%3i",Parameter.User1,Parameter.User2); |
371 | LCD_printfxy(0,0,"UP1:%3i UP2:%3i",Parameter.User1,Parameter.User2); |
372 | LCD_printfxy(0,1,"UP3:%3i UP4:%3i",Parameter.User3,Parameter.User4); |
372 | LCD_printfxy(0,1,"UP3:%3i UP4:%3i",Parameter.User3,Parameter.User4); |
373 | LCD_printfxy(0,2,"UP5:%3i UP6:%3i",Parameter.User5,Parameter.User6); |
373 | LCD_printfxy(0,2,"UP5:%3i UP6:%3i",Parameter.User5,Parameter.User6); |
374 | LCD_printfxy(0,3,"UP7:%3i UP8:%3i",Parameter.User7,Parameter.User8); |
374 | LCD_printfxy(0,3,"UP7:%3i UP8:%3i",Parameter.User7,Parameter.User8); |
375 | break; |
375 | break; |
376 | case 17: // User Parameter |
376 | case 17: // User Parameter |
377 | LCD_printfxy(0,0,"SD-Card Logs"); |
377 | LCD_printfxy(0,0,"SD-Card Logs"); |
378 | LCD_printfxy(0,1,"GPX:%4i (%3ims) ",Logged_GPX_Counter,LogCfg.GPX_Interval); |
378 | LCD_printfxy(0,1,"GPX:%4i (%3ims) ",Logged_GPX_Counter,LogCfg.GPX_Interval); |
379 | LCD_printfxy(0,2,"KML:%4i (%3ims) ",Logged_KML_Counter,LogCfg.KML_Interval); |
379 | LCD_printfxy(0,2,"KML:%4i (%3ims) ",Logged_KML_Counter,LogCfg.KML_Interval); |
380 | break; |
380 | break; |
381 | case 18: // magnetic field |
381 | case 18: // magnetic field |
382 | if(Compass_CalState) |
382 | if(Compass_CalState) |
383 | { |
383 | { |
384 | LCD_printfxy(0,0,"Calibration:"); |
384 | LCD_printfxy(0,0,"Calibration:"); |
385 | LCD_printfxy(0,1,"Step %d/", Compass_CalState); |
385 | LCD_printfxy(0,1,"Step %d/", Compass_CalState); |
386 | LCD_printfxy(0,2,"X %4i Y %4i Z %4i",MagVector.X,MagVector.Y,MagVector.Z); |
386 | LCD_printfxy(0,2,"X %4i Y %4i Z %4i",MagVector.X,MagVector.Y,MagVector.Z); |
387 | LCD_printfxy(9,3,"(ESC)(NEXT)"); |
387 | LCD_printfxy(9,3,"(ESC)(NEXT)"); |
388 | switch(Compass_CalState) |
388 | switch(Compass_CalState) |
389 | { |
389 | { |
390 | case 1: |
390 | case 1: |
391 | case 3: |
391 | case 3: |
392 | LCD_printfxy(7,1,"pause"); |
392 | LCD_printfxy(7,1,"pause"); |
393 | break; |
393 | break; |
394 | 394 | ||
395 | case 2: |
395 | case 2: |
396 | LCD_printfxy(7,1,"horizontal"); |
396 | LCD_printfxy(7,1,"horizontal"); |
397 | break; |
397 | break; |
398 | 398 | ||
399 | case 4: |
399 | case 4: |
400 | LCD_printfxy(7,1,"vertical"); |
400 | LCD_printfxy(7,1,"vertical"); |
401 | break; |
401 | break; |
402 | 402 | ||
403 | case 5: |
403 | case 5: |
404 | LCD_printfxy(7,1,"data saved"); |
404 | LCD_printfxy(7,1,"data saved"); |
405 | LCD_printfxy(8,3," (END) "); |
405 | LCD_printfxy(8,3," (END) "); |
406 | break; |
406 | break; |
407 | 407 | ||
408 | default: |
408 | default: |
409 | break; |
409 | break; |
410 | } |
410 | } |
411 | } |
411 | } |
412 | else |
412 | else |
413 | { |
413 | { |
414 | if(GeoMagDec < 0) sign = '-'; |
414 | if(GeoMagDec < 0) sign = '-'; |
415 | else sign = '+'; |
415 | else sign = '+'; |
416 | LCD_printfxy(0,0,"Magnetic Field"); |
416 | LCD_printfxy(0,0,"Magnetic Field"); |
417 | LCD_printfxy(0,1,"X:%5i",MagVector.X); |
417 | LCD_printfxy(0,1,"X:%5i",MagVector.X); |
418 | LCD_printfxy(0,2,"Y:%5i",MagVector.Y); |
418 | LCD_printfxy(0,2,"Y:%5i",MagVector.Y); |
419 | LCD_printfxy(0,3,"Z:%5i",MagVector.Z); |
419 | LCD_printfxy(0,3,"Z:%5i",MagVector.Z); |
420 | LCD_printfxy(8,1,"Field:%3i",EarthMagneticField/5); |
420 | LCD_printfxy(8,1,"Field:%3i",EarthMagneticField/5); |
- | 421 | if(I2C_CompassPort == I2C_EXTERN_0) LCD_printfxy(12,2,"Extern") else LCD_printfxy(12,2,"Intern"); |
|
421 | // LCD_printfxy(8,2,"Dec:%c%i.%1i", sign, abs(GeoMagDec)/10,abs(GeoMagDec)%10); |
422 | // LCD_printfxy(8,2,"Dec:%c%i.%1i", sign, abs(GeoMagDec)/10,abs(GeoMagDec)%10); |
422 | // LCD_printfxy(8,3,"Inc:%2i", EarthMagneticInclination); |
423 | // LCD_printfxy(8,3,"Inc:%2i", EarthMagneticInclination); |
423 | LCD_printfxy(15,3,"(CAL)"); |
424 | LCD_printfxy(15,3,"(CAL)"); |
424 | } |
425 | } |
425 | if(Keys & KEY4) // next step |
426 | if(Keys & KEY4) // next step |
426 | { |
427 | { |
427 | if(Compass_CalState <5) Compass_SetCalState(Compass_CalState+1); |
428 | if(Compass_CalState <5) Compass_SetCalState(Compass_CalState+1); |
428 | else Compass_SetCalState(0); |
429 | else Compass_SetCalState(0); |
429 | } |
430 | } |
430 | if(Keys & KEY3)Compass_SetCalState(0); // cancel |
431 | if(Keys & KEY3)Compass_SetCalState(0); // cancel |
431 | break; |
432 | break; |
432 | case 19: |
433 | case 19: |
433 | if(GeoMagDec < 0) sign = '-'; |
434 | if(GeoMagDec < 0) sign = '-'; |
434 | else sign = '+'; |
435 | else sign = '+'; |
435 | LCD_printfxy(0,0,"Magnetic Field"); |
436 | LCD_printfxy(0,0,"Magnetic Field"); |
436 | LCD_printfxy(0,1,"Field:%3i (Percent)",EarthMagneticField/5); |
437 | LCD_printfxy(0,1,"Field:%3i (Percent)",EarthMagneticField/5); |
437 | LCD_printfxy(0,2,"Declination:%c%i.%1i ", sign, abs(GeoMagDec)/10,abs(GeoMagDec)%10); |
438 | LCD_printfxy(0,2,"Declination:%c%i.%1i ", sign, abs(GeoMagDec)/10,abs(GeoMagDec)%10); |
438 | LCD_printfxy(0,3,"Inclination:%2i (%2i)", EarthMagneticInclination, EarthMagneticInclinationTheoretic); |
439 | LCD_printfxy(0,3,"Inclination:%2i (%2i)", EarthMagneticInclination, EarthMagneticInclinationTheoretic); |
439 | break; |
440 | break; |
440 | case 20: |
441 | case 20: |
441 | LCD_printfxy(0,0,"SD-Setting "); |
442 | LCD_printfxy(0,0,"SD-Setting "); |
442 | LCD_printfxy(0,2,"WP-Dynamic:%4i ",WaypointAcceleration); |
443 | LCD_printfxy(0,2,"WP-Dynamic:%4i ",WaypointAcceleration); |
443 | break; |
444 | break; |
444 | case 21: |
445 | case 21: |
445 | LCD_printfxy(0,0,"CPU Processing "); |
446 | LCD_printfxy(0,0,"CPU Processing "); |
446 | LCD_printfxy(0,2,"GPS-Data: %2i.%iHz ",FreqNewGpsDataIn5Sec/10, FreqNewGpsDataIn5Sec%10); |
447 | LCD_printfxy(0,2,"GPS-Data: %2i.%iHz ",FreqNewGpsDataIn5Sec/10, FreqNewGpsDataIn5Sec%10); |
447 | LCD_printfxy(0,3,"GPS-Update:%2i.%iHz ",FreqGpsProcessedIn5Sec/10, FreqGpsProcessedIn5Sec%10); |
448 | LCD_printfxy(0,3,"GPS-Update:%2i.%iHz ",FreqGpsProcessedIn5Sec/10, FreqGpsProcessedIn5Sec%10); |
448 | if(FreqNewGpsDataIn5Sec >= 48 && FreqNewGpsDataIn5Sec <= 52) LCD_printfxy(18,2,"OK") else LCD_printfxy(18,2,"!!"); |
449 | if(FreqNewGpsDataIn5Sec >= 48 && FreqNewGpsDataIn5Sec <= 52) LCD_printfxy(18,2,"OK") else LCD_printfxy(18,2,"!!"); |
449 | if(FreqGpsProcessedIn5Sec >= 350) LCD_printfxy(18,3,"OK") else LCD_printfxy(18,3,"!!"); |
450 | if(FreqGpsProcessedIn5Sec >= 350) LCD_printfxy(18,3,"OK") else LCD_printfxy(18,3,"!!"); |
450 | break; |
451 | break; |
451 | case 22: |
452 | case 22: |
452 | LCD_printfxy(0,0,"BL Current" ); |
453 | LCD_printfxy(0,0,"BL Current" ); |
453 | LCD_printfxy(11,3,"(in 0.1A)" ); |
454 | LCD_printfxy(11,3,"(in 0.1A)" ); |
454 | for(i1 = 0; i1 < 3; i1++) |
455 | for(i1 = 0; i1 < 3; i1++) |
455 | { |
456 | { |
456 | LCD_printfxy(0,i1+1,"%3d %3d %3d %3d ",BL3_Current(i1*4),BL3_Current(i1*4+1),BL3_Current(i1*4+2),BL3_Current(i1*4+3)); |
457 | LCD_printfxy(0,i1+1,"%3d %3d %3d %3d ",BL3_Current(i1*4),BL3_Current(i1*4+1),BL3_Current(i1*4+2),BL3_Current(i1*4+3)); |
457 | if(Motor[4 + i1 * 4].State == 0) break; |
458 | if(Motor[4 + i1 * 4].State == 0) break; |
458 | } |
459 | } |
459 | 460 | ||
460 | break; |
461 | break; |
461 | default: |
462 | default: |
462 | //MaxMenuItem = MenuItem - 1; |
463 | //MaxMenuItem = MenuItem - 1; |
463 | MenuItem = 0; |
464 | MenuItem = 0; |
464 | break; |
465 | break; |
465 | } |
466 | } |
466 | } |
467 | } |
467 | 468 |