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