Rev 729 | Rev 780 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 729 | Rev 740 | ||
---|---|---|---|
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 "uart0.h" |
67 | #include "uart0.h" |
68 | #include "uart1.h" |
68 | #include "uart1.h" |
69 | #include "ncmag.h" |
69 | #include "ncmag.h" |
70 | #include "logging.h" |
70 | #include "logging.h" |
71 | #include "settings.h" |
71 | #include "settings.h" |
72 | #include "sdc.h" |
72 | #include "sdc.h" |
73 | #include "analog.h" |
73 | #include "analog.h" |
74 | #include "canbus.h" |
74 | #include "canbus.h" |
75 | #include "triggerlog.h" |
75 | #include "triggerlog.h" |
76 | #include "CamCtrl.h" |
76 | #include "CamCtrl.h" |
77 | 77 | ||
78 | u8 DispPtr = 0; |
78 | u8 DispPtr = 0; |
79 | s8 DisplayBuff[DISPLAYBUFFSIZE]; |
79 | s8 DisplayBuff[DISPLAYBUFFSIZE]; |
80 | 80 | ||
81 | 81 | ||
82 | u8 MenuItem = 0; |
82 | u8 MenuItem = 0; |
83 | u8 MaxMenuItem = 30; |
83 | u8 MaxMenuItem = 30; |
84 | 84 | ||
85 | void Menu_Putchar(char c) |
85 | void Menu_Putchar(char c) |
86 | { |
86 | { |
87 | if(DispPtr < DISPLAYBUFFSIZE) DisplayBuff[DispPtr++] = c; ; |
87 | if(DispPtr < DISPLAYBUFFSIZE) DisplayBuff[DispPtr++] = c; ; |
88 | } |
88 | } |
89 | 89 | ||
90 | void Menu_Clear(void) |
90 | void Menu_Clear(void) |
91 | { |
91 | { |
92 | u8 i; |
92 | u8 i; |
93 | for( i = 0; i < DISPLAYBUFFSIZE; i++) DisplayBuff[i] = ' '; |
93 | for( i = 0; i < DISPLAYBUFFSIZE; i++) DisplayBuff[i] = ' '; |
94 | } |
94 | } |
95 | 95 | ||
96 | // Display with 20 characters in 4 lines |
96 | // Display with 20 characters in 4 lines |
97 | void Menu_Update(u8 Keys) |
97 | void Menu_Update(u8 Keys) |
98 | { |
98 | { |
99 | s32 i1,i2; |
99 | s32 i1,i2; |
100 | u8 sign; |
100 | u8 sign; |
101 | 101 | ||
102 | if(Keys & KEY1) { if(MenuItem > 0) MenuItem--; else MenuItem = MaxMenuItem;} |
102 | if(Keys & KEY1) { if(MenuItem > 0) MenuItem--; else MenuItem = MaxMenuItem;} |
103 | if(Keys & KEY2) { if(MenuItem == MaxMenuItem) MenuItem = 0; else MenuItem++;} |
103 | if(Keys & KEY2) { if(MenuItem == MaxMenuItem) MenuItem = 0; else MenuItem++;} |
104 | if((Keys & KEY1) && (Keys & KEY2)) MenuItem = 0; |
104 | if((Keys & KEY1) && (Keys & KEY2)) MenuItem = 0; |
105 | if(MenuItem > MaxMenuItem) MenuItem = MaxMenuItem; |
105 | if(MenuItem > MaxMenuItem) MenuItem = MaxMenuItem; |
106 | Menu_Clear(); |
106 | Menu_Clear(); |
107 | // print menu item number in the upper right corner |
107 | // print menu item number in the upper right corner |
108 | if(MenuItem < 10) |
108 | if(MenuItem < 10) |
109 | { |
109 | { |
110 | LCD_printfxy(17,0,"[%i]",MenuItem); |
110 | LCD_printfxy(17,0,"[%i]",MenuItem); |
111 | } |
111 | } |
112 | else // Menuitem >= 10 |
112 | else // Menuitem >= 10 |
113 | { |
113 | { |
114 | LCD_printfxy(16,0,"[%i]",MenuItem); |
114 | LCD_printfxy(16,0,"[%i]",MenuItem); |
115 | } |
115 | } |
116 | 116 | ||
117 | switch(MenuItem) |
117 | switch(MenuItem) |
118 | { |
118 | { |
119 | // Version Info |
119 | // Version Info |
120 | case 0: |
120 | case 0: |
121 | if(IamMaster == SLAVE) LCD_printfxy(0,0,"+ Navi-Ctrl (S) +") |
121 | if(IamMaster == SLAVE) LCD_printfxy(0,0,"+ Navi-Ctrl (S) +") |
122 | else |
122 | else |
123 | if(IamMaster == MASTER)LCD_printfxy(0,0,"+ Navi-Ctrl (M) +") |
123 | if(IamMaster == MASTER)LCD_printfxy(0,0,"+ Navi-Ctrl (M) +") |
124 | else LCD_printfxy(0,0,"++ Navi-Ctrl ++") |
124 | else LCD_printfxy(0,0,"++ Navi-Ctrl ++") |
125 | 125 | ||
126 | 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); |
126 | 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); |
127 | if(FC.StatusFlags3 & FC_STATUS3_REDUNDANCE_AKTIVE) LCD_printfxy(19,1,"R"); |
127 | if(FC.StatusFlags3 & FC_STATUS3_REDUNDANCE_AKTIVE) LCD_printfxy(19,1,"R"); |
128 | if(ErrorCode) |
128 | if(ErrorCode) |
129 | { |
129 | { |
130 | LCD_printfxy(0,2,"Error: %d",ErrorCode); |
130 | LCD_printfxy(0,2,"Error: %d",ErrorCode); |
131 | LCD_printfxy(0,3,"%s",ErrorMSG); |
131 | LCD_printfxy(0,3,"%s",ErrorMSG); |
132 | } |
132 | } |
133 | else |
133 | else |
134 | if(Partner.ErrorCode) |
134 | if(Partner.ErrorCode) |
135 | { |
135 | { |
136 | if(IamMaster == SLAVE) LCD_printfxy(0,2,"Master Err: %d",Partner.ErrorCode) |
136 | if(IamMaster == SLAVE) LCD_printfxy(0,2,"Master Err: %d",Partner.ErrorCode) |
137 | else LCD_printfxy(0,2,"Slave Err: %d",Partner.ErrorCode); |
137 | else LCD_printfxy(0,2,"Slave Err: %d",Partner.ErrorCode); |
138 | LCD_printfxy(0,3,"%s",PartnerErrorMSG); |
138 | LCD_printfxy(0,3,"%s",PartnerErrorMSG); |
139 | } |
139 | } |
140 | else |
140 | else |
141 | { |
141 | { |
142 | LCD_printfxy(0,2,"Set:%d %s", Parameter.ActiveSetting,EE_Parameter.Name); |
142 | LCD_printfxy(0,2,"Set:%d %s", Parameter.ActiveSetting,EE_Parameter.Name); |
143 | LCD_printfxy(0,3,"%s",ErrorMSG); |
143 | LCD_printfxy(0,3,"%s",ErrorMSG); |
144 | // LCD_printfxy(0,3,"(c) HiSystems GmbH"); |
144 | // LCD_printfxy(0,3,"(c) HiSystems GmbH"); |
145 | } |
145 | } |
146 | if(FC.StatusFlags3 & FC_STATUS3_BOAT) LCD_printfxy(16,2,"BOAT"); |
146 | if(FC.StatusFlags3 & FC_STATUS3_BOAT) LCD_printfxy(16,2,"BOAT"); |
147 | break; |
147 | break; |
148 | case 1: |
148 | case 1: |
149 | if(IamMaster == SLAVE) LCD_printfxy(0,0,"++ Master - NC ++") |
149 | if(IamMaster == SLAVE) LCD_printfxy(0,0,"++ Master - NC ++") |
150 | else LCD_printfxy(0,0,"++ Slave - NC ++"); |
150 | else LCD_printfxy(0,0,"++ Slave - NC ++"); |
151 | 151 | ||
152 | if(CanRxMessage[CAN_ID_VERSION].D.Byte[3]) |
152 | if(CanRxMessage[CAN_ID_VERSION].D.Byte[3]) |
153 | { |
153 | { |
154 | LCD_printfxy(0,1,"HW V%d.%d SW V%d.%02d%c", CanRxMessage[CAN_ID_VERSION].D.Byte[3]/10, CanRxMessage[CAN_ID_VERSION].D.Byte[3]%10, CanRxMessage[CAN_ID_VERSION].D.Byte[7], CanRxMessage[CAN_ID_VERSION].D.Byte[6], 'a'+ CanRxMessage[CAN_ID_VERSION].D.Byte[5]); |
154 | LCD_printfxy(0,1,"HW V%d.%d SW V%d.%02d%c", CanRxMessage[CAN_ID_VERSION].D.Byte[3]/10, CanRxMessage[CAN_ID_VERSION].D.Byte[3]%10, CanRxMessage[CAN_ID_VERSION].D.Byte[7], CanRxMessage[CAN_ID_VERSION].D.Byte[6], 'a'+ CanRxMessage[CAN_ID_VERSION].D.Byte[5]); |
155 | if(Partner.ErrorCode) |
155 | if(Partner.ErrorCode) |
156 | { |
156 | { |
157 | if(IamMaster == SLAVE) LCD_printfxy(0,2,"Master Err: %d",Partner.ErrorCode) |
157 | if(IamMaster == SLAVE) LCD_printfxy(0,2,"Master Err: %d",Partner.ErrorCode) |
158 | else LCD_printfxy(0,2,"Slave Err: %d",Partner.ErrorCode); |
158 | else LCD_printfxy(0,2,"Slave Err: %d",Partner.ErrorCode); |
159 | } |
159 | } |
160 | else |
160 | else |
161 | { |
161 | { |
162 | LCD_printfxy(0,2,"Set:%d", CanRxMessage[CAN_ID_VERSION].D.Byte[1]); |
162 | LCD_printfxy(0,2,"Set:%d", CanRxMessage[CAN_ID_VERSION].D.Byte[1]); |
163 | } |
163 | } |
164 | LCD_printfxy(0,3,"%s",PartnerErrorMSG); |
164 | LCD_printfxy(0,3,"%s",PartnerErrorMSG); |
165 | if(Partner.StatusFlags3 & FC_STATUS3_BOAT) LCD_printfxy(16,2,"BOAT"); |
165 | if(Partner.StatusFlags3 & FC_STATUS3_BOAT) LCD_printfxy(16,2,"BOAT"); |
166 | } |
166 | } |
167 | else |
167 | else |
168 | LCD_printfxy(0,2,"not connected", CanTxMessage[CAN_ID_VERSION].D.Byte[1]); |
168 | LCD_printfxy(0,2,"not connected", CanTxMessage[CAN_ID_VERSION].D.Byte[1]); |
169 | break; |
169 | break; |
170 | case 2: |
170 | case 2: |
171 | if (GPSData.Status == INVALID) |
171 | if (GPSData.Status == INVALID) |
172 | { |
172 | { |
173 | LCD_printfxy(0,0,"No GPS data"); |
173 | LCD_printfxy(0,0,"No GPS data"); |
174 | LCD_printfxy(0,1,"Lon: "); |
174 | LCD_printfxy(0,1,"Lon: "); |
175 | LCD_printfxy(0,2,"Lat: "); |
175 | LCD_printfxy(0,2,"Lat: "); |
176 | LCD_printfxy(0,3,"Alt: "); |
176 | LCD_printfxy(0,3,"Alt: "); |
177 | } |
177 | } |
178 | else // newdata or processed |
178 | else // newdata or processed |
179 | { |
179 | { |
180 | LCD_printfxy(0,0,"Sat:%02d ", GPSData.NumOfSats); |
180 | LCD_printfxy(0,0,"Sat:%02d ", GPSData.NumOfSats); |
181 | switch (GPSData.SatFix) |
181 | switch (GPSData.SatFix) |
182 | { |
182 | { |
183 | case SATFIX_NONE: |
183 | case SATFIX_NONE: |
184 | LCD_printfxy(7,0,"NoFix"); |
184 | LCD_printfxy(7,0,"NoFix"); |
185 | break; |
185 | break; |
186 | case SATFIX_2D: |
186 | case SATFIX_2D: |
187 | LCD_printfxy(7,0,"2DFix"); |
187 | LCD_printfxy(7,0,"2DFix"); |
188 | break; |
188 | break; |
189 | case SATFIX_3D: |
189 | case SATFIX_3D: |
190 | LCD_printfxy(7,0,"3DFix"); |
190 | LCD_printfxy(7,0,"3DFix"); |
191 | break; |
191 | break; |
192 | default: |
192 | default: |
193 | LCD_printfxy(7,0,"??Fix"); |
193 | LCD_printfxy(7,0,"??Fix"); |
194 | break; |
194 | break; |
195 | } |
195 | } |
196 | if(GPSData.Flags & FLAG_DIFFSOLN) |
196 | if(GPSData.Flags & FLAG_DIFFSOLN) |
197 | { |
197 | { |
198 | LCD_printfxy(12,0,"/DGPS"); |
198 | LCD_printfxy(12,0,"/DGPS"); |
199 | } |
199 | } |
200 | else |
200 | else |
201 | { |
201 | { |
202 | LCD_printfxy(12,0," "); |
202 | LCD_printfxy(12,0," "); |
203 | } |
203 | } |
204 | 204 | ||
205 | if(GPSData.Position.Longitude < 0) sign = '-'; |
205 | if(GPSData.Position.Longitude < 0) sign = '-'; |
206 | else sign = '+'; |
206 | else sign = '+'; |
207 | i1 = abs(GPSData.Position.Longitude)/10000000L; |
207 | i1 = abs(GPSData.Position.Longitude)/10000000L; |
208 | i2 = abs(GPSData.Position.Longitude)%10000000L; |
208 | i2 = abs(GPSData.Position.Longitude)%10000000L; |
209 | LCD_printfxy(0,1,"Lon:%c%03ld.%07ld deg",sign, i1, i2); |
209 | LCD_printfxy(0,1,"Lon:%c%03ld.%07ld deg",sign, i1, i2); |
210 | if(GPSData.Position.Latitude < 0) sign = '-'; |
210 | if(GPSData.Position.Latitude < 0) sign = '-'; |
211 | else sign = '+'; |
211 | else sign = '+'; |
212 | i1 = abs(GPSData.Position.Latitude)/10000000L; |
212 | i1 = abs(GPSData.Position.Latitude)/10000000L; |
213 | i2 = abs(GPSData.Position.Latitude)%10000000L; |
213 | i2 = abs(GPSData.Position.Latitude)%10000000L; |
214 | LCD_printfxy(0,2,"Lat:%c%03ld.%07ld deg",sign, i1, i2); |
214 | LCD_printfxy(0,2,"Lat:%c%03ld.%07ld deg",sign, i1, i2); |
215 | if(GPSData.Position.Altitude < 0) sign = '-'; |
215 | if(GPSData.Position.Altitude < 0) sign = '-'; |
216 | else sign = '+'; |
216 | else sign = '+'; |
217 | i1 = abs(GPSData.Position.Altitude)/1000L; |
217 | i1 = abs(GPSData.Position.Altitude)/1000L; |
218 | i2 = abs(GPSData.Position.Altitude)%1000L; |
218 | i2 = abs(GPSData.Position.Altitude)%1000L; |
219 | LCD_printfxy(0,3,"Alt:%c%04ld.%03ldm V%d", sign, i1, i2, GPS_Version/1000); |
219 | LCD_printfxy(0,3,"Alt:%c%04ld.%03ldm V%d", sign, i1, i2, GPS_Version/1000); |
220 | } |
220 | } |
221 | break; |
221 | break; |
222 | case 3: |
222 | case 3: |
223 | if (GPSData.Status == INVALID) |
223 | if (GPSData.Status == INVALID) |
224 | { |
224 | { |
225 | LCD_printfxy(0,0,"No GPS data"); |
225 | LCD_printfxy(0,0,"No GPS data"); |
226 | LCD_printfxy(0,1,"Speed N: "); |
226 | LCD_printfxy(0,1,"Speed N: "); |
227 | LCD_printfxy(0,2,"Speed E: "); |
227 | LCD_printfxy(0,2,"Speed E: "); |
228 | LCD_printfxy(0,3,"Speed T: "); |
228 | LCD_printfxy(0,3,"Speed T: "); |
229 | } |
229 | } |
230 | else // newdata or processed |
230 | else // newdata or processed |
231 | { |
231 | { |
232 | LCD_printfxy(0,0,"Sat:%02d ", GPSData.NumOfSats); |
232 | LCD_printfxy(0,0,"Sat:%02d ", GPSData.NumOfSats); |
233 | switch (GPSData.SatFix) |
233 | switch (GPSData.SatFix) |
234 | { |
234 | { |
235 | case SATFIX_NONE: |
235 | case SATFIX_NONE: |
236 | LCD_printfxy(7,0,"NoFix"); |
236 | LCD_printfxy(7,0,"NoFix"); |
237 | break; |
237 | break; |
238 | case SATFIX_2D: |
238 | case SATFIX_2D: |
239 | LCD_printfxy(7,0,"2DFix"); |
239 | LCD_printfxy(7,0,"2DFix"); |
240 | break; |
240 | break; |
241 | case SATFIX_3D: |
241 | case SATFIX_3D: |
242 | LCD_printfxy(7,0,"3DFix"); |
242 | LCD_printfxy(7,0,"3DFix"); |
243 | break; |
243 | break; |
244 | default: |
244 | default: |
245 | LCD_printfxy(7,0,"??Fix"); |
245 | LCD_printfxy(7,0,"??Fix"); |
246 | break; |
246 | break; |
247 | } |
247 | } |
248 | if(GPSData.Flags & FLAG_DIFFSOLN) |
248 | if(GPSData.Flags & FLAG_DIFFSOLN) |
249 | { |
249 | { |
250 | LCD_printfxy(12,0,"/DGPS"); |
250 | LCD_printfxy(12,0,"/DGPS"); |
251 | } |
251 | } |
252 | else |
252 | else |
253 | { |
253 | { |
254 | LCD_printfxy(12,0," "); |
254 | LCD_printfxy(12,0," "); |
255 | } |
255 | } |
256 | 256 | ||
257 | LCD_printfxy(0,1,"Speed N: %+4ld cm/s",GPSData.Speed_North); |
257 | LCD_printfxy(0,1,"Speed N: %+4ld cm/s",GPSData.Speed_North); |
258 | LCD_printfxy(0,2,"Speed E: %+4ld cm/s",GPSData.Speed_East); |
258 | LCD_printfxy(0,2,"Speed E: %+4ld cm/s",GPSData.Speed_East); |
259 | LCD_printfxy(0,3,"Speed T: %+4ld cm/s",GPSData.Speed_Top); |
259 | LCD_printfxy(0,3,"Speed T: %+4ld cm/s",GPSData.Speed_Top); |
260 | } |
260 | } |
261 | break; |
261 | break; |
262 | case 4: |
262 | case 4: |
263 | LCD_printfxy(0,0,"GPS UTC Time"); |
263 | LCD_printfxy(0,0,"GPS UTC Time"); |
264 | if (!SystemTime.Valid) |
264 | if (!SystemTime.Valid) |
265 | { |
265 | { |
266 | LCD_printfxy(0,1," "); |
266 | LCD_printfxy(0,1," "); |
267 | LCD_printfxy(0,2," No time data! "); |
267 | LCD_printfxy(0,2," No time data! "); |
268 | LCD_printfxy(0,3," "); |
268 | LCD_printfxy(0,3," "); |
269 | } |
269 | } |
270 | else // newdata or processed |
270 | else // newdata or processed |
271 | { |
271 | { |
272 | LCD_printfxy(0,1," "); |
272 | LCD_printfxy(0,1," "); |
273 | LCD_printfxy(0,2,"Date: %02i/%02i/%04i",SystemTime.Month, SystemTime.Day, SystemTime.Year); |
273 | LCD_printfxy(0,2,"Date: %02i/%02i/%04i",SystemTime.Month, SystemTime.Day, SystemTime.Year); |
274 | LCD_printfxy(0,3,"Time: %02i:%02i:%02i.%03i", SystemTime.Hour, SystemTime.Min, SystemTime.Sec, SystemTime.mSec); |
274 | LCD_printfxy(0,3,"Time: %02i:%02i:%02i.%03i", SystemTime.Hour, SystemTime.Min, SystemTime.Sec, SystemTime.mSec); |
275 | } |
275 | } |
276 | break; |
276 | break; |
277 | case 5: // Navi Params 1 from FC |
277 | case 5: // Navi Params 1 from FC |
278 | LCD_printfxy(0,0,"NaviMode: %3i" , Parameter.NaviGpsModeControl); |
278 | LCD_printfxy(0,0,"NaviMode: %3i" , Parameter.NaviGpsModeControl); |
279 | LCD_printfxy(0,1,"G :%3i P :%3i ",Parameter.NaviGpsGain, Parameter.NaviGpsP); |
279 | LCD_printfxy(0,1,"G :%3i P :%3i ",Parameter.NaviGpsGain, Parameter.NaviGpsP); |
280 | LCD_printfxy(0,2,"I :%3i D :%3i ",Parameter.NaviGpsI, Parameter.NaviGpsD); |
280 | LCD_printfxy(0,2,"I :%3i D :%3i ",Parameter.NaviGpsI, Parameter.NaviGpsD); |
281 | LCD_printfxy(0,3,"ACC:%3i SAT:%3i ",Parameter.NaviGpsACC, Parameter.NaviGpsMinSat); |
281 | LCD_printfxy(0,3,"ACC:%3i SAT:%3i ",Parameter.NaviGpsACC, Parameter.NaviGpsMinSat); |
282 | break; |
282 | break; |
283 | case 6: // Navi Params 2 from FC |
283 | case 6: // Navi Params 2 from FC |
284 | LCD_printfxy(0,0,"Stick TS: %3i", Parameter.NaviStickThreshold); |
284 | LCD_printfxy(0,0,"Stick TS: %3i", Parameter.NaviStickThreshold); |
285 | LCD_printfxy(0,1,"WP_Radius: %3im",MaxWP_Radius_in_m); |
285 | LCD_printfxy(0,1,"WP_Radius: %3im",MaxWP_Radius_in_m); |
286 | LCD_printfxy(0,2,"WindCorr: %3i", Parameter.NaviWindCorrection); |
286 | LCD_printfxy(0,2,"WindCorr: %3i", Parameter.NaviWindCorrection); |
287 | LCD_printfxy(0,3,"AccComp: %3i", Parameter.NaviSpeedCompensation); |
287 | LCD_printfxy(0,3,"AccComp: %3i", Parameter.NaviSpeedCompensation); |
288 | break; |
288 | break; |
289 | case 7: // Navi Params 3 from FC |
289 | case 7: // Navi Params 3 from FC |
290 | LCD_printfxy(0,0,"Angle-Limit: %3i", Parameter.NaviAngleLimitation); |
290 | LCD_printfxy(0,0,"Angle-Limit: %3i", Parameter.NaviAngleLimitation); |
291 | LCD_printfxy(0,1," P-Limit: %3i", Parameter.NaviGpsPLimit); |
291 | LCD_printfxy(0,1," P-Limit: %3i", Parameter.NaviGpsPLimit); |
292 | LCD_printfxy(0,2," I-Limit: %3i", Parameter.NaviGpsILimit); |
292 | LCD_printfxy(0,2," I-Limit: %3i", Parameter.NaviGpsILimit); |
293 | LCD_printfxy(0,3," D-Limit: %3i", Parameter.NaviGpsDLimit); |
293 | LCD_printfxy(0,3," D-Limit: %3i", Parameter.NaviGpsDLimit); |
294 | break; |
294 | break; |
295 | case 8: // Max Ranges |
295 | case 8: // Max Ranges |
296 | LCD_printfxy(0,0,"Maximum flying "); |
296 | LCD_printfxy(0,0,"Maximum flying "); |
297 | LCD_printfxy(0,1,"Range: %4im ", AbsoluteFlyingRange_m); |
297 | LCD_printfxy(0,1,"Range: %4im ", AbsoluteFlyingRange_m); |
298 | LCD_printfxy(0,2,"Descend: %4im ", AutoDescendRange_m); |
298 | LCD_printfxy(0,2,"Descend: %4im ", AutoDescendRange_m); |
299 | LCD_printfxy(0,3,"Altitude:%4im ", AbsoluteFlyingAltitude); |
299 | LCD_printfxy(0,3,"Altitude:%4im ", AbsoluteFlyingAltitude); |
300 | if(!AbsoluteFlyingRange_m) LCD_printfxy(9,1,"disabled"); |
300 | if(!AbsoluteFlyingRange_m) LCD_printfxy(9,1,"disabled"); |
301 | if(!AutoDescendRange_m) LCD_printfxy(9,2,"disabled"); |
301 | if(!AutoDescendRange_m) LCD_printfxy(9,2,"disabled"); |
302 | if(!AbsoluteFlyingAltitude) LCD_printfxy(9,3,"disabled"); |
302 | if(!AbsoluteFlyingAltitude) LCD_printfxy(9,3,"disabled"); |
303 | break; |
303 | break; |
304 | case 9: |
304 | case 9: |
305 | LCD_printfxy(0,0,"Home Position"); |
305 | LCD_printfxy(0,0,"Home Position"); |
306 | if(NaviData.HomePosition.Status == INVALID) |
306 | if(NaviData.HomePosition.Status == INVALID) |
307 | { |
307 | { |
308 | LCD_printfxy(0,1," "); |
308 | LCD_printfxy(0,1," "); |
309 | LCD_printfxy(0,2," Is not set. "); |
309 | LCD_printfxy(0,2," Is not set. "); |
310 | LCD_printfxy(0,3," "); |
310 | LCD_printfxy(0,3," "); |
311 | } |
311 | } |
312 | else |
312 | else |
313 | { |
313 | { |
314 | if(NaviData.HomePosition.Longitude < 0) sign = '-'; |
314 | if(NaviData.HomePosition.Longitude < 0) sign = '-'; |
315 | else sign = '+'; |
315 | else sign = '+'; |
316 | i1 = abs(NaviData.HomePosition.Longitude)/10000000L; |
316 | i1 = abs(NaviData.HomePosition.Longitude)/10000000L; |
317 | i2 = abs(NaviData.HomePosition.Longitude)%10000000L; |
317 | i2 = abs(NaviData.HomePosition.Longitude)%10000000L; |
318 | LCD_printfxy(0,1,"Lon:%c%03ld.%07ld deg",sign, i1, i2); |
318 | LCD_printfxy(0,1,"Lon:%c%03ld.%07ld deg",sign, i1, i2); |
319 | if(NaviData.HomePosition.Latitude < 0) sign = '-'; |
319 | if(NaviData.HomePosition.Latitude < 0) sign = '-'; |
320 | else sign = '+'; |
320 | else sign = '+'; |
321 | i1 = abs(NaviData.HomePosition.Latitude)/10000000L; |
321 | i1 = abs(NaviData.HomePosition.Latitude)/10000000L; |
322 | i2 = abs(NaviData.HomePosition.Latitude)%10000000L; |
322 | i2 = abs(NaviData.HomePosition.Latitude)%10000000L; |
323 | LCD_printfxy(0,2,"Lat:%c%03ld.%07ld deg",sign, i1, i2); |
323 | LCD_printfxy(0,2,"Lat:%c%03ld.%07ld deg",sign, i1, i2); |
324 | if(NaviData.HomePosition.Altitude < 0) sign = '-'; |
324 | if(NaviData.HomePosition.Altitude < 0) sign = '-'; |
325 | else sign = '+'; |
325 | else sign = '+'; |
326 | i1 = abs(NaviData.HomePosition.Altitude)/1000L; |
326 | i1 = abs(NaviData.HomePosition.Altitude)/1000L; |
327 | i2 = abs(NaviData.HomePosition.Altitude)%1000L; |
327 | i2 = abs(NaviData.HomePosition.Altitude)%1000L; |
328 | LCD_printfxy(0,3,"Alt:%c%04ld.%1dm",sign, i1, i2/1000); |
328 | LCD_printfxy(0,3,"Alt:%c%04ld.%1dm",sign, i1, i2/1000); |
329 | switch(Parameter.HomeYawMode) |
329 | switch(Parameter.HomeYawMode) |
330 | { |
330 | { |
331 | case NO_CHANGE: LCD_printfxy(17,3,"(-)"); break; |
331 | case NO_CHANGE: LCD_printfxy(17,3,"(-)"); break; |
332 | case FRONT_TO_HOME: LCD_printfxy(17,3,"(F)"); break; |
332 | case FRONT_TO_HOME: LCD_printfxy(17,3,"(F)"); break; |
333 | case REAR_TO_HOME: LCD_printfxy(17,3,"(R)"); break; |
333 | case REAR_TO_HOME: LCD_printfxy(17,3,"(R)"); break; |
334 | case LIKE_AT_START: LCD_printfxy(17,3,"(S)"); break; |
334 | case LIKE_AT_START: LCD_printfxy(17,3,"(S)"); break; |
335 | } |
335 | } |
336 | } |
336 | } |
337 | break; |
337 | break; |
338 | case 10: |
338 | case 10: |
339 | LCD_printfxy(0,0,"Target Position"); |
339 | LCD_printfxy(0,0,"Target Position"); |
340 | if(NaviData.TargetPosition.Status == INVALID) |
340 | if(NaviData.TargetPosition.Status == INVALID) |
341 | { |
341 | { |
342 | LCD_printfxy(0,1," "); |
342 | LCD_printfxy(0,1," "); |
343 | LCD_printfxy(0,2," Is not set. "); |
343 | LCD_printfxy(0,2," Is not set. "); |
344 | LCD_printfxy(0,3," "); |
344 | LCD_printfxy(0,3," "); |
345 | } |
345 | } |
346 | else |
346 | else |
347 | { |
347 | { |
348 | if(NaviData.TargetPosition.Longitude < 0) sign = '-'; |
348 | if(NaviData.TargetPosition.Longitude < 0) sign = '-'; |
349 | else sign = '+'; |
349 | else sign = '+'; |
350 | i1 = abs(NaviData.TargetPosition.Longitude)/10000000L; |
350 | i1 = abs(NaviData.TargetPosition.Longitude)/10000000L; |
351 | i2 = abs(NaviData.TargetPosition.Longitude)%10000000L; |
351 | i2 = abs(NaviData.TargetPosition.Longitude)%10000000L; |
352 | LCD_printfxy(0,1,"Lon:%c%03ld.%07ld deg",sign, i1, i2); |
352 | LCD_printfxy(0,1,"Lon:%c%03ld.%07ld deg",sign, i1, i2); |
353 | if(NaviData.TargetPosition.Latitude < 0) sign = '-'; |
353 | if(NaviData.TargetPosition.Latitude < 0) sign = '-'; |
354 | else sign = '+'; |
354 | else sign = '+'; |
355 | i1 = abs(NaviData.TargetPosition.Latitude)/10000000L; |
355 | i1 = abs(NaviData.TargetPosition.Latitude)/10000000L; |
356 | i2 = abs(NaviData.TargetPosition.Latitude)%10000000L; |
356 | i2 = abs(NaviData.TargetPosition.Latitude)%10000000L; |
357 | LCD_printfxy(0,2,"Lat:%c%03ld.%07ld deg",sign, i1, i2); |
357 | LCD_printfxy(0,2,"Lat:%c%03ld.%07ld deg",sign, i1, i2); |
358 | if(NaviData.HomePosition.Altitude < 0) sign = '-'; |
358 | if(NaviData.HomePosition.Altitude < 0) sign = '-'; |
359 | else sign = '+'; |
359 | else sign = '+'; |
360 | i1 = abs(NaviData.TargetPosition.Altitude)/1000L; |
360 | i1 = abs(NaviData.TargetPosition.Altitude)/1000L; |
361 | i2 = abs(NaviData.TargetPosition.Altitude)%1000L; |
361 | i2 = abs(NaviData.TargetPosition.Altitude)%1000L; |
362 | LCD_printfxy(0,3,"Alt:%c%04ld.%03ldm",sign, i1, i2); |
362 | LCD_printfxy(0,3,"Alt:%c%04ld.%03ldm",sign, i1, i2); |
363 | } |
363 | } |
364 | break; |
364 | break; |
365 | case 11: // RC stick controls from FC |
365 | case 11: // RC stick controls from FC |
366 | LCD_printfxy(0,0,"RC-Sticks" ); |
366 | LCD_printfxy(0,0,"RC-Sticks" ); |
367 | LCD_printfxy(0,1,"Ni:%4i Ro:%4i ",FC.StickNick, FC.StickRoll); |
367 | LCD_printfxy(0,1,"Ni:%4i Ro:%4i ",FC.StickNick, FC.StickRoll); |
368 | LCD_printfxy(0,2,"Gs:%4i Ya:%4i ",FC.StickGas, FC.StickYaw); |
368 | LCD_printfxy(0,2,"Gs:%4i Ya:%4i ",FC.StickGas, FC.StickYaw); |
369 | LCD_printfxy(0,3,"RC-Level: %3i", FC.RC_Quality); // Remote Control Level from FC |
369 | LCD_printfxy(0,3,"RC-Level: %3i", FC.RC_Quality); // Remote Control Level from FC |
370 | break; |
370 | break; |
371 | case 12: // RC poti controls from FC |
371 | case 12: // RC poti controls from FC |
372 | LCD_printfxy(0,0,"RC-Potis 1" ); |
372 | LCD_printfxy(0,0,"RC-Potis 1" ); |
373 | LCD_printfxy(0,1,"Po1:%3i Po2:%3i ",FC.Poti[0], FC.Poti[1]); |
373 | LCD_printfxy(0,1,"Po1:%3i Po2:%3i ",FC.Poti[0], FC.Poti[1]); |
374 | LCD_printfxy(0,2,"Po3:%3i Po4:%3i ",FC.Poti[2], FC.Poti[3]); |
374 | LCD_printfxy(0,2,"Po3:%3i Po4:%3i ",FC.Poti[2], FC.Poti[3]); |
375 | break; |
375 | break; |
376 | case 13: // RC poti controls from FC |
376 | case 13: // RC poti controls from FC |
377 | LCD_printfxy(0,0,"RC-Potis 2" ); |
377 | LCD_printfxy(0,0,"RC-Potis 2" ); |
378 | LCD_printfxy(0,1,"Po5:%3i Po6:%3i ",FC.Poti[4], FC.Poti[5]); |
378 | LCD_printfxy(0,1,"Po5:%3i Po6:%3i ",FC.Poti[4], FC.Poti[5]); |
379 | LCD_printfxy(0,2,"Po7:%3i Po8:%3i ",FC.Poti[6], FC.Poti[7]); |
379 | LCD_printfxy(0,2,"Po7:%3i Po8:%3i ",FC.Poti[6], FC.Poti[7]); |
380 | break; |
380 | break; |
381 | case 14: // attitude from FC |
381 | case 14: // attitude from FC |
382 | if(FromFlightCtrl.AngleNick < 0) sign = '-'; |
382 | if(FromFlightCtrl.AngleNick < 0) sign = '-'; |
383 | else sign = '+'; |
383 | else sign = '+'; |
384 | i1 = abs(FromFlightCtrl.AngleNick)/10; |
384 | i1 = abs(FromFlightCtrl.AngleNick)/10; |
385 | i2 = abs(FromFlightCtrl.AngleNick)%10; |
385 | i2 = abs(FromFlightCtrl.AngleNick)%10; |
386 | LCD_printfxy(0,0,"GyroNick:%c%03ld.%01ld", sign, i1, i2); |
386 | LCD_printfxy(0,0,"GyroNick:%c%03ld.%01ld", sign, i1, i2); |
387 | if(FromFlightCtrl.AngleRoll < 0) sign = '-'; |
387 | if(FromFlightCtrl.AngleRoll < 0) sign = '-'; |
388 | else sign = '+'; |
388 | else sign = '+'; |
389 | i1 = abs(FromFlightCtrl.AngleRoll)/10; |
389 | i1 = abs(FromFlightCtrl.AngleRoll)/10; |
390 | i2 = abs(FromFlightCtrl.AngleRoll)%10; |
390 | i2 = abs(FromFlightCtrl.AngleRoll)%10; |
391 | LCD_printfxy(0,1,"GyroRoll:%c%03ld.%01ld", sign, i1, i2); |
391 | LCD_printfxy(0,1,"GyroRoll:%c%03ld.%01ld", sign, i1, i2); |
392 | if(FromFlightCtrl_AccNick < 0) sign = '-'; |
392 | if(FromFlightCtrl_AccNick < 0) sign = '-'; |
393 | else sign = '+'; |
393 | else sign = '+'; |
394 | i1 = abs(FromFlightCtrl_AccNick)/10; |
394 | i1 = abs(FromFlightCtrl_AccNick)/10; |
395 | i2 = abs(FromFlightCtrl_AccNick)%10; |
395 | i2 = abs(FromFlightCtrl_AccNick)%10; |
396 | LCD_printfxy(0,2," AccNick:%c%03ld.%01ld", sign, i1, i2); |
396 | LCD_printfxy(0,2," AccNick:%c%03ld.%01ld", sign, i1, i2); |
397 | if(FromFlightCtrl_AccRoll < 0) sign = '-'; |
397 | if(FromFlightCtrl_AccRoll < 0) sign = '-'; |
398 | else sign = '+'; |
398 | else sign = '+'; |
399 | i1 = abs(FromFlightCtrl_AccRoll)/10; |
399 | i1 = abs(FromFlightCtrl_AccRoll)/10; |
400 | i2 = abs(FromFlightCtrl_AccRoll)%10; |
400 | i2 = abs(FromFlightCtrl_AccRoll)%10; |
401 | LCD_printfxy(0,3," AccRoll:%c%03ld.%01ld", sign, i1, i2); |
401 | LCD_printfxy(0,3," AccRoll:%c%03ld.%01ld", sign, i1, i2); |
402 | break; |
402 | break; |
403 | case 15: |
403 | case 15: |
404 | LCD_printfxy(0,0,"Analog inputs"); |
404 | LCD_printfxy(0,0,"Analog inputs"); |
405 | LCD_printfxy(0,1,"A5:%3i ",AnalogData.Ch5); |
405 | LCD_printfxy(0,1,"A5:%3i ",AnalogData.Ch5); |
406 | LCD_printfxy(0,2,"A6:%3i ",AnalogData.Ch6); |
406 | LCD_printfxy(0,2,"A6:%3i ",AnalogData.Ch6); |
407 | LCD_printfxy(0,3,"A7:%3i ",AnalogData.Ch7); |
407 | LCD_printfxy(0,3,"A7:%3i ",AnalogData.Ch7); |
408 | break; |
408 | break; |
409 | case 16: |
409 | case 16: |
410 | LCD_printfxy(0,0,"Compass: %3i", FromFlightCtrl.GyroHeading / 10); |
410 | LCD_printfxy(0,0,"Compass: %3i", FromFlightCtrl.GyroHeading / 10); |
411 | LCD_printfxy(0,1,"Man.-Offset:%3i", FC.FromFC_CompassOffset / 10); |
411 | LCD_printfxy(0,1,"Man.-Offset:%3i", FC.FromFC_CompassOffset / 10); |
412 | if(FC.FromFC_DisableDeclination) |
412 | if(FC.FromFC_DisableDeclination) |
413 | { |
413 | { |
414 | LCD_printfxy(0,2,"Mag.Declinat.:disabl"); |
414 | LCD_printfxy(0,2,"Mag.Declinat.:disabl"); |
415 | } |
415 | } |
416 | else |
416 | else |
417 | { |
417 | { |
418 | if(GeoMagDec < 0) sign = '-'; |
418 | if(GeoMagDec < 0) sign = '-'; |
419 | else sign = '+'; |
419 | else sign = '+'; |
420 | LCD_printfxy(0,2,"Mag.Declinat.:%c%i.%1i", sign, abs(GeoMagDec)/10,abs(GeoMagDec)%10); |
420 | LCD_printfxy(0,2,"Mag.Declinat.:%c%i.%1i", sign, abs(GeoMagDec)/10,abs(GeoMagDec)%10); |
421 | } |
421 | } |
422 | LCD_printfxy(0,3,"True Compass: %3i", GyroCompassCorrected/10); |
422 | LCD_printfxy(0,3,"True Compass: %3i", GyroCompassCorrected/10); |
423 | break; |
423 | break; |
424 | case 17: // User Parameter |
424 | case 17: // User Parameter |
425 | LCD_printfxy(0,0,"UP1:%3i UP2:%3i",Parameter.User1,Parameter.User2); |
425 | LCD_printfxy(0,0,"UP1:%3i UP2:%3i",Parameter.User1,Parameter.User2); |
426 | LCD_printfxy(0,1,"UP3:%3i UP4:%3i",Parameter.User3,Parameter.User4); |
426 | LCD_printfxy(0,1,"UP3:%3i UP4:%3i",Parameter.User3,Parameter.User4); |
427 | LCD_printfxy(0,2,"UP5:%3i UP6:%3i",Parameter.User5,Parameter.User6); |
427 | LCD_printfxy(0,2,"UP5:%3i UP6:%3i",Parameter.User5,Parameter.User6); |
428 | LCD_printfxy(0,3,"UP7:%3i UP8:%3i",Parameter.User7,Parameter.User8); |
428 | LCD_printfxy(0,3,"UP7:%3i UP8:%3i",Parameter.User7,Parameter.User8); |
429 | break; |
429 | break; |
430 | case 18: // User Parameter |
430 | case 18: // User Parameter |
431 | LCD_printfxy(0,0,"SD-Card Logs"); |
431 | LCD_printfxy(0,0,"SD-Card Logs"); |
432 | if(SDCardInfo.Valid == 1) |
432 | if(SDCardInfo.Valid == 1) |
433 | { |
433 | { |
434 | LCD_printfxy(0,1,"GPX: %4i (%3ims) ",Logged_GPX_Counter,LogCfg.GPX_Interval); |
434 | LCD_printfxy(0,1,"GPX: %4i (%3ims) ",Logged_GPX_Counter,LogCfg.GPX_Interval); |
435 | LCD_printfxy(0,2,"KML: %4i (%3ims) ",Logged_KML_Counter,LogCfg.KML_Interval); |
435 | LCD_printfxy(0,2,"KML: %4i (%3ims) ",Logged_KML_Counter,LogCfg.KML_Interval); |
436 | LCD_printfxy(0,3,"Trig:%4i ",Logged_TRIG_Counter); |
436 | LCD_printfxy(0,3,"Trig:%4i ",Logged_TRIG_Counter); |
437 | } |
437 | } |
438 | else |
438 | else |
439 | LCD_printfxy(0,1,"no card in slot "); |
439 | LCD_printfxy(0,1,"no card in slot "); |
440 | break; |
440 | break; |
441 | case 19: // magnetic field |
441 | case 19: // magnetic field |
442 | if(Compass_CalState) |
442 | if(Compass_CalState) |
443 | { |
443 | { |
444 | LCD_printfxy(0,0,"Calibration:"); |
444 | LCD_printfxy(0,0,"Calibration:"); |
445 | LCD_printfxy(0,1,"Step %d/", Compass_CalState); |
445 | LCD_printfxy(0,1,"Step %d/", Compass_CalState); |
446 | LCD_printfxy(0,2,"X %4i Y %4i Z %4i",MagVector.X,MagVector.Y,MagVector.Z); |
446 | LCD_printfxy(0,2,"X %4i Y %4i Z %4i",MagVector.X,MagVector.Y,MagVector.Z); |
447 | LCD_printfxy(9,3,"(ESC)(NEXT)"); |
447 | LCD_printfxy(9,3,"(ESC)(NEXT)"); |
448 | switch(Compass_CalState) |
448 | switch(Compass_CalState) |
449 | { |
449 | { |
450 | case 1: |
450 | case 1: |
451 | case 3: |
451 | case 3: |
452 | LCD_printfxy(7,1,"pause"); |
452 | LCD_printfxy(7,1,"pause"); |
453 | break; |
453 | break; |
454 | 454 | ||
455 | case 2: |
455 | case 2: |
456 | LCD_printfxy(7,1,"horizontal"); |
456 | LCD_printfxy(7,1,"horizontal"); |
457 | break; |
457 | break; |
458 | 458 | ||
459 | case 4: |
459 | case 4: |
460 | LCD_printfxy(7,1,"vertical"); |
460 | LCD_printfxy(7,1,"vertical"); |
461 | break; |
461 | break; |
462 | 462 | ||
463 | case 5: |
463 | case 5: |
464 | LCD_printfxy(7,1,"data saved"); |
464 | LCD_printfxy(7,1,"data saved"); |
465 | LCD_printfxy(8,3," (END) "); |
465 | LCD_printfxy(8,3," (END) "); |
466 | break; |
466 | break; |
467 | 467 | ||
468 | default: |
468 | default: |
469 | break; |
469 | break; |
470 | } |
470 | } |
471 | } |
471 | } |
472 | else |
472 | else |
473 | { |
473 | { |
474 | if(GeoMagDec < 0) sign = '-'; |
474 | if(GeoMagDec < 0) sign = '-'; |
475 | else sign = '+'; |
475 | else sign = '+'; |
476 | LCD_printfxy(0,0,"Magnetic Field"); |
476 | LCD_printfxy(0,0,"Magnetic Field"); |
477 | LCD_printfxy(0,1,"X:%5i",MagVector.X); |
477 | LCD_printfxy(0,1,"X:%5i",MagVector.X); |
478 | LCD_printfxy(0,2,"Y:%5i",MagVector.Y); |
478 | LCD_printfxy(0,2,"Y:%5i",MagVector.Y); |
479 | LCD_printfxy(0,3,"Z:%5i",MagVector.Z); |
479 | LCD_printfxy(0,3,"Z:%5i",MagVector.Z); |
480 | LCD_printfxy(8,1,"Field:%3i",EarthMagneticField/5); |
480 | LCD_printfxy(8,1,"Field:%3i",EarthMagneticField/5); |
481 | if(Compass_I2CPort == NCMAG_PORT_EXTERN) LCD_printfxy(11,2,"Extern") |
481 | if(Compass_I2CPort == NCMAG_PORT_EXTERN) LCD_printfxy(11,2,"Extern") |
482 | else LCD_printfxy(11,2,"Intern"); |
482 | else LCD_printfxy(11,2,"Intern"); |
483 | // LCD_printfxy(8,2,"Dec:%c%i.%1i", sign, abs(GeoMagDec)/10,abs(GeoMagDec)%10); |
483 | // LCD_printfxy(8,2,"Dec:%c%i.%1i", sign, abs(GeoMagDec)/10,abs(GeoMagDec)%10); |
484 | // LCD_printfxy(8,3,"Inc:%2i", EarthMagneticInclination); |
484 | // LCD_printfxy(8,3,"Inc:%2i", EarthMagneticInclination); |
485 | LCD_printfxy(15,3,"(CAL)"); |
485 | LCD_printfxy(15,3,"(CAL)"); |
486 | } |
486 | } |
487 | if(Keys & KEY4) // next step |
487 | if(Keys & KEY4) // next step |
488 | { |
488 | { |
489 | if(Compass_CalState <5) Compass_SetCalState(Compass_CalState+1); |
489 | if(Compass_CalState <5) Compass_SetCalState(Compass_CalState+1); |
490 | else Compass_SetCalState(0); |
490 | else Compass_SetCalState(0); |
491 | } |
491 | } |
492 | if(Keys & KEY3)Compass_SetCalState(0); // cancel |
492 | if(Keys & KEY3)Compass_SetCalState(0); // cancel |
493 | break; |
493 | break; |
494 | case 20: |
494 | case 20: |
495 | if(GeoMagDec < 0) sign = '-'; |
495 | if(GeoMagDec < 0) sign = '-'; |
496 | else sign = '+'; |
496 | else sign = '+'; |
497 | LCD_printfxy(0,0,"Magnetic Field"); |
497 | LCD_printfxy(0,0,"Magnetic Field"); |
498 | LCD_printfxy(0,1,"Field:%3i (Percent)",EarthMagneticField/5); |
498 | LCD_printfxy(0,1,"Field:%3i (Percent)",EarthMagneticField/5); |
499 | LCD_printfxy(0,2,"Declination:%c%i.%1i ", sign, abs(GeoMagDec)/10,abs(GeoMagDec)%10); |
499 | LCD_printfxy(0,2,"Declination:%c%i.%1i ", sign, abs(GeoMagDec)/10,abs(GeoMagDec)%10); |
500 | LCD_printfxy(0,3,"Inclination:%2i (%2i)", EarthMagneticInclination, EarthMagneticInclinationTheoretic); |
500 | LCD_printfxy(0,3,"Inclination:%2i (%2i)", EarthMagneticInclination, EarthMagneticInclinationTheoretic); |
501 | break; |
501 | break; |
502 | case 21: |
502 | case 21: |
503 | LCD_printfxy(0,0,"SD-Setting "); |
503 | LCD_printfxy(0,0,"SD-Setting "); |
504 | LCD_printfxy(0,2,"WP-Dynamic:%4i ",WaypointAcceleration); |
504 | LCD_printfxy(0,2,"WP-Dynamic:%4i ",WaypointAcceleration); |
505 | break; |
505 | break; |
506 | case 22: |
506 | case 22: |
507 | LCD_printfxy(0,0,"CPU Processing "); |
507 | LCD_printfxy(0,0,"CPU Processing "); |
508 | LCD_printfxy(0,2,"GPS-Data: %2i.%iHz ",FreqNewGpsData/10, FreqNewGpsData%10); |
508 | LCD_printfxy(0,2,"GPS-Data: %2i.%iHz ",FreqNewGpsData/10, FreqNewGpsData%10); |
509 | LCD_printfxy(0,3,"GPS-Update:%2i.%iHz ",FreqGpsNavProcessed/10, FreqGpsNavProcessed%10); |
509 | LCD_printfxy(0,3,"GPS-Update:%2i.%iHz ",FreqGpsNavProcessed/10, FreqGpsNavProcessed%10); |
510 | if(FreqNewGpsData >= 48 && FreqNewGpsData <= 52) LCD_printfxy(18,2,"OK") else LCD_printfxy(18,2,"!!"); |
510 | if(FreqNewGpsData >= 48 && FreqNewGpsData <= 52) LCD_printfxy(18,2,"OK") else LCD_printfxy(18,2,"!!"); |
511 | if(FreqGpsNavProcessed >= 350) LCD_printfxy(18,3,"OK") else LCD_printfxy(18,3,"!!"); |
511 | if(FreqGpsNavProcessed >= 350) LCD_printfxy(18,3,"OK") else LCD_printfxy(18,3,"!!"); |
512 | break; |
512 | break; |
513 | case 23: |
513 | case 23: |
514 | LCD_printfxy(0,0,"BL Current" ); |
514 | LCD_printfxy(0,0,"BL Current" ); |
515 | LCD_printfxy(11,3,"(in 0.1A)" ); |
515 | LCD_printfxy(11,3,"(in 0.1A)" ); |
516 | for(i1 = 0; i1 < 3; i1++) |
516 | for(i1 = 0; i1 < 3; i1++) |
517 | { |
517 | { |
518 | 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)); |
518 | 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)); |
519 | if(Motor[4 + i1 * 4].State == 0) break; |
519 | if(Motor[4 + i1 * 4].State == 0) break; |
520 | } |
520 | } |
521 | break; |
521 | break; |
522 | 522 | ||
523 | case 24: |
523 | case 24: |
524 | LCD_printfxy(0,0,"Ext. Compass" ); |
524 | LCD_printfxy(0,0,"Ext. Compass" ); |
525 | if(NCMAG_Compass_use_Orientation) |
525 | if(NCMAG_Compass_use_Orientation) |
526 | { |
526 | { |
527 | u8 tmp; |
527 | u8 tmp; |
528 | LCD_printfxy(0,1,"ACC X Y Z"); |
528 | LCD_printfxy(0,1,"ACC X Y Z"); |
529 | LCD_printfxy(0,2," %5d %5d %5d", AccVector.X/40, AccVector.Y/40, AccVector.Z/40); |
529 | LCD_printfxy(0,2," %5d %5d %5d", AccVector.X/40, AccVector.Y/40, AccVector.Z/40); |
530 | tmp = NCMAG_GetOrientationFromAcc(); |
530 | tmp = NCMAG_GetOrientationFromAcc(); |
531 | LCD_printfxy(0,3,"Orientat.: "); |
531 | LCD_printfxy(0,3,"Orientat.: "); |
532 | if(!tmp) LCD_printfxy(11,3,"??") else LCD_printfxy(11,3,"%2d",tmp); |
532 | if(!tmp) LCD_printfxy(11,3,"??") else LCD_printfxy(11,3,"%2d",tmp); |
533 | LCD_printfxy(15,3,"(%d)",NCMAG_Orientation); |
533 | LCD_printfxy(15,3,"(%d)",NCMAG_Orientation); |
534 | } |
534 | } |
535 | else |
535 | else |
536 | { |
536 | { |
537 | LCD_printfxy(0,1,"Not connected"); |
537 | LCD_printfxy(0,1,"Not connected"); |
538 | } |
538 | } |
539 | break; |
539 | break; |
540 | case 25: |
540 | case 25: |
541 | { |
541 | { |
542 | static u8 index = 1; |
542 | static u8 index = 1; |
543 | if(Keys & KEY3) // next step |
543 | if(Keys & KEY3) // next step |
544 | { |
544 | { |
545 | if(index < ToFC_MaxWpListIndex) index++; |
545 | if(index < ToFC_MaxWpListIndex) index++; |
546 | else index = 1; |
546 | else index = 1; |
547 | } |
547 | } |
548 | if(Keys & KEY4) FromFC_LoadWP_List = index; |
548 | if(Keys & KEY4) FromFC_LoadWP_List = index; |
549 | LCD_printfxy(0,0,"Load WPL (fix)" ); |
549 | LCD_printfxy(0,0,"Load WPL (fix)" ); |
550 | LCD_printfxy(0,1,"Name: %s", WPL_Store.Name); |
550 | LCD_printfxy(0,1,"Name: %s", WPL_Store.Name); |
551 | // 12345678901234567890 |
551 | // 12345678901234567890 |
552 | LCD_printfxy(0,2,"Points Index "); |
552 | LCD_printfxy(0,2,"Points Index "); |
553 | LCD_printfxy(0,3," %3d %3d LOAD", PointList_GetCount(), index); |
553 | LCD_printfxy(0,3," %3d %3d LOAD", PointList_GetCount(), index); |
554 | } |
554 | } |
555 | break; |
555 | break; |
556 | case 26: |
556 | case 26: |
557 | { |
557 | { |
558 | static u8 index = 1; |
558 | static u8 index = 1; |
559 | if(Keys & KEY3) |
559 | if(Keys & KEY3) |
560 | { |
560 | { |
561 | if(index < ToFC_MaxWpListIndex) index++; |
561 | if(index < ToFC_MaxWpListIndex) index++; |
562 | else index = 1; |
562 | else index = 1; |
563 | } |
563 | } |
564 | LCD_printfxy(0,0,"Load WPL (Rel)" ); |
564 | LCD_printfxy(0,0,"Load WPL (Rel)" ); |
565 | LCD_printfxy(0,1,"Name: %s", WPL_Store.Name); |
565 | LCD_printfxy(0,1,"Name: %s", WPL_Store.Name); |
566 | // 12345678901234567890 |
566 | // 12345678901234567890 |
567 | LCD_printfxy(0,2,"Points Index "); |
567 | LCD_printfxy(0,2,"Points Index "); |
568 | if(GPSData.SatFix == SATFIX_3D) |
568 | if(GPSData.SatFix == SATFIX_3D) |
569 | { |
569 | { |
570 | LCD_printfxy(0,3," %3d %3d LOAD", PointList_GetCount(), index); |
570 | LCD_printfxy(0,3," %3d %3d LOAD", PointList_GetCount(), index); |
571 | if(Keys & KEY4) FromFC_LoadWP_List = index | 0x80; |
571 | if(Keys & KEY4) FromFC_LoadWP_List = index | 0x80; |
572 | } |
572 | } |
573 | else LCD_printfxy(0,3," No Satfix ! ", index); |
573 | else LCD_printfxy(0,3," No Satfix ! ", index); |
574 | 574 | ||
575 | } |
575 | } |
576 | break; |
576 | break; |
577 | case 27: |
577 | case 27: |
578 | { |
578 | { |
579 | static u8 index = 1; |
579 | static u8 index = 1; |
580 | if(Keys & KEY3) |
580 | if(Keys & KEY3) |
581 | { |
581 | { |
582 | if(index < ToFC_MaxWpListIndex) index++; |
582 | if(index < ToFC_MaxWpListIndex) index++; |
583 | else index = 1; |
583 | else index = 1; |
584 | } |
584 | } |
585 | if(Keys & KEY4) FromFC_Load_SinglePoint = index; |
585 | if(Keys & KEY4) FromFC_Load_SinglePoint = index; |
586 | LCD_printfxy(0,0,"Load Point" ); |
586 | LCD_printfxy(0,0,"Load Point" ); |
587 | LCD_printfxy(0,1,"Name: %s", WPL_Store.Name); |
587 | LCD_printfxy(0,1,"Name: %s", WPL_Store.Name); |
588 | // 12345678901234567890 |
588 | // 12345678901234567890 |
589 | // LCD_printfxy(0,2,"Points Index "); |
589 | // LCD_printfxy(0,2,"Points Index "); |
590 | LCD_printfxy(0,3,"Number: %3d (LOAD)", index); |
590 | LCD_printfxy(0,3,"Number: %3d (LOAD)", index); |
591 | } |
591 | } |
592 | break; |
592 | break; |
593 | case 28: |
593 | case 28: |
594 | { |
594 | { |
595 | static u8 index = 1; |
595 | static u8 index = 1; |
596 | if(Keys & KEY3) |
596 | if(Keys & KEY3) |
597 | { |
597 | { |
598 | if(index < ToFC_MaxWpListIndex) index++; |
598 | if(index < ToFC_MaxWpListIndex) index++; |
599 | else index = 1; |
599 | else index = 1; |
600 | } |
600 | } |
601 | LCD_printfxy(0,0,"Save Point" ); |
601 | LCD_printfxy(0,0,"Save Point" ); |
602 | LCD_printfxy(0,1,"Alt: %3dm", NaviData.Altimeter/20); |
602 | LCD_printfxy(0,1,"Alt: %3dm", NaviData.Altimeter_5cm/20); |
603 | // 12345678901234567890 |
603 | // 12345678901234567890 |
604 | LCD_printfxy(0,2,"Dir: %3d ", CompassSetpointCorrected/10); |
604 | LCD_printfxy(0,2,"Dir: %3d ", CompassSetpointCorrected/10); |
605 | if(GPSData.SatFix == SATFIX_3D) |
605 | if(GPSData.SatFix == SATFIX_3D) |
606 | { |
606 | { |
607 | LCD_printfxy(0,3,"Number: %3d (SAVE)", index); |
607 | LCD_printfxy(0,3,"Number: %3d (SAVE)", index); |
608 | if(Keys & KEY4) FromFC_Save_SinglePoint = index; |
608 | if(Keys & KEY4) FromFC_Save_SinglePoint = index; |
609 | } |
609 | } |
610 | else LCD_printfxy(0,3," No Satfix ! ", index); |
610 | else LCD_printfxy(0,3," No Satfix ! ", index); |
611 | } |
611 | } |
612 | break; |
612 | break; |
613 | /* case 28: |
613 | /* case 28: |
614 | LCD_printfxy(0,0,"Analog inputs"); |
614 | LCD_printfxy(0,0,"Analog inputs"); |
615 | LCD_printfxy(0,0,"A0:%3i A1:%3i",AnalogData.Ch0,AnalogData.Ch1); |
615 | LCD_printfxy(0,0,"A0:%3i A1:%3i",AnalogData.Ch0,AnalogData.Ch1); |
616 | LCD_printfxy(0,1,"A2:%3i A3:%3i",AnalogData.Ch2,AnalogData.Ch3); |
616 | LCD_printfxy(0,1,"A2:%3i A3:%3i",AnalogData.Ch2,AnalogData.Ch3); |
617 | LCD_printfxy(0,2,"A4:%3i A5:%3i",AnalogData.Ch4,AnalogData.Ch5); |
617 | LCD_printfxy(0,2,"A4:%3i A5:%3i",AnalogData.Ch4,AnalogData.Ch5); |
618 | LCD_printfxy(0,3,"A6:%3i A7:%3i",AnalogData.Ch6,AnalogData.Ch7); |
618 | LCD_printfxy(0,3,"A6:%3i A7:%3i",AnalogData.Ch6,AnalogData.Ch7); |
619 | break; |
619 | break; |
620 | */ |
620 | */ |
621 | 621 | ||
622 | case 29: |
622 | case 29: |
623 | LCD_printfxy(0,0,"Trigger Input"); |
623 | LCD_printfxy(0,0,"Trigger Input"); |
624 | if(UART_VersionInfo.HWMajor >= 30) |
624 | if(UART_VersionInfo.HWMajor >= 30) |
625 | { |
625 | { |
626 | if(BlitzSchuhConnected) LCD_printfxy(0,1,"External") |
626 | if(BlitzSchuhConnected) LCD_printfxy(0,1,"External") |
627 | else LCD_printfxy(0,1,"Internal"); |
627 | else LCD_printfxy(0,1,"Internal"); |
628 | LCD_printfxy(0,2,"Counter:%4d ",TrigLogging.Count); |
628 | LCD_printfxy(0,2,"Counter:%4d ",TrigLogging.Count); |
629 | LCD_printfxy(0,3,"Logfile:%4i ",Logged_TRIG_Counter); |
629 | LCD_printfxy(0,3,"Logfile:%4i ",Logged_TRIG_Counter); |
630 | } |
630 | } |
631 | else |
631 | else |
632 | { |
632 | { |
633 | LCD_printfxy(0,1,"Not Supported in "); |
633 | LCD_printfxy(0,1,"Not Supported in "); |
634 | LCD_printfxy(0,2,"Hardware V%d ", UART_VersionInfo.HWMajor/10); |
634 | LCD_printfxy(0,2,"Hardware V%d ", UART_VersionInfo.HWMajor/10); |
635 | LCD_printfxy(0,3,"(V3 required)"); |
635 | LCD_printfxy(0,3,"(V3 required)"); |
636 | } |
636 | } |
637 | break; |
637 | break; |
638 | case 30: |
638 | case 30: |
639 | LCD_printfxy(0,0,"CamCtrl"); |
639 | LCD_printfxy(0,0,"CamCtrl"); |
640 | if(!(FromCamCtrl.CamStatus & CAM_STATE_I2C_OK)) |
640 | if(!(FromCamCtrl.CamStatus & CAM_STATE_I2C_OK)) |
641 | { |
641 | { |
642 | LCD_printfxy(0,2,"Not connected"); |
642 | LCD_printfxy(0,2,"Not connected"); |
643 | if(CamCtrlTimeout < 10) LCD_printfxy(14,3,"(conn)"); // connect manually |
643 | if(CamCtrlTimeout < 10) LCD_printfxy(14,3,"(conn)"); // connect manually |
644 | if(Keys & KEY4) CamCtrlTimeout = 65000; |
644 | if(Keys & KEY4) CamCtrlTimeout = 65000; |
645 | } |
645 | } |
646 | else |
646 | else |
647 | { |
647 | { |
648 | LCD_printfxy(8,0,"V%i.%02i",1 + FromCamCtrl.Version / 100, FromCamCtrl.Version % 100); |
648 | LCD_printfxy(8,0,"V%i.%02i",1 + FromCamCtrl.Version / 100, FromCamCtrl.Version % 100); |
649 | 649 | ||
650 | switch(FromCamCtrl.Type) |
650 | switch(FromCamCtrl.Type) |
651 | { |
651 | { |
652 | case TYPE_LANC: LCD_printfxy(13,0,"L"); break; |
652 | case TYPE_LANC: LCD_printfxy(13,0,"L"); break; |
653 | case TYPE_IR: LCD_printfxy(13,0,"I"); break; |
653 | case TYPE_IR: LCD_printfxy(13,0,"I"); break; |
654 | case TYPE_MULTI: LCD_printfxy(13,0,"M"); break; |
654 | case TYPE_MULTI: LCD_printfxy(13,0,"M"); break; |
655 | } |
655 | } |
656 | LCD_printfxy(0,0,"CamCtrl"); |
656 | LCD_printfxy(0,0,"CamCtrl"); |
657 | LCD_printfxy(0,1,"Stat:"); |
657 | LCD_printfxy(0,1,"Stat:"); |
658 | if(FromCamCtrl.CamStatus & CAM_STATE_RDY) LCD_printfxy(5,1,"RDY") |
658 | if(FromCamCtrl.CamStatus & CAM_STATE_RDY) LCD_printfxy(5,1,"RDY") |
659 | if(FromCamCtrl.CamStatus & CAM_STATE_REC_ACTIVE) LCD_printfxy(10,1,"REC"); |
659 | if(FromCamCtrl.CamStatus & CAM_STATE_REC_ACTIVE) LCD_printfxy(10,1,"REC"); |
660 | if(FromCamCtrl.CamStatus & CAM_STATE_PHOTO_MODE) LCD_printfxy(14,1,"PHOTO"); |
660 | if(FromCamCtrl.CamStatus & CAM_STATE_PHOTO_MODE) LCD_printfxy(14,1,"PHOTO"); |
661 | if(FromCamCtrl.CamStatus & CAM_STATE_ZOOM) LCD_printfxy(5,1,"ZOOM "); |
661 | if(FromCamCtrl.CamStatus & CAM_STATE_ZOOM) LCD_printfxy(5,1,"ZOOM "); |
662 | if(!(FromCamCtrl.CamStatus & CAM_STATE_RDY)) LCD_printfxy(5,1," ---"); |
662 | if(!(FromCamCtrl.CamStatus & CAM_STATE_RDY)) LCD_printfxy(5,1," ---"); |
663 | 663 | ||
664 | LCD_printfxy(17,1,"(%c)",CamCtrlCharacter); |
664 | LCD_printfxy(17,1,"(%c)",CamCtrlCharacter); |
665 | 665 | ||
666 | if(FromCamCtrl.CamStatus & CAM_STATE_CAM_DISCONN) LCD_printfxy(0,2,"Disconn.") |
666 | if(FromCamCtrl.CamStatus & CAM_STATE_CAM_DISCONN) LCD_printfxy(0,2,"Disconn.") |
667 | else |
667 | else |
668 | { |
668 | { |
669 | if(FromCamCtrl.CamStatus & CAM_STATE_OFF) LCD_printfxy(1,2,"Cam:OFF") else LCD_printfxy(1,2,"Cam:ON"); |
669 | if(FromCamCtrl.CamStatus & CAM_STATE_OFF) LCD_printfxy(1,2,"Cam:OFF") else LCD_printfxy(1,2,"Cam:ON"); |
670 | } |
670 | } |
671 | LCD_printfxy(11,2,"Pics:%3d ",FromCamCtrl.PhotoCount); |
671 | LCD_printfxy(11,2,"Pics:%3d ",FromCamCtrl.PhotoCount); |
672 | //LCD_printfxy(5,2,"x%2x ",FromCamCtrl.CamStatus); |
672 | //LCD_printfxy(5,2,"x%2x ",FromCamCtrl.CamStatus); |
673 | if(FromCamCtrl.PPM1Okay) LCD_printfxy(0,3,"Zoom:%3i",FromCamCtrl.PPM1Data); |
673 | if(FromCamCtrl.PPM1Okay) LCD_printfxy(0,3,"Zoom:%3i",FromCamCtrl.PPM1Data); |
674 | if(!FromCamCtrl.PPM2Okay) // there is PPM Input connected to the CamCtrl |
674 | if(!FromCamCtrl.PPM2Okay) // there is PPM Input connected to the CamCtrl |
675 | { |
675 | { |
676 | LCD_printfxy(14,3,"(TRIG)"); |
676 | LCD_printfxy(14,3,"(TRIG)"); |
677 | if(EE_Parameter.CamCtrlModeChannel == 0) |
677 | if(EE_Parameter.CamCtrlModeChannel == 0) |
678 | { |
678 | { |
679 | if(FromCamCtrl.CamStatus & CAM_STATE_REC_ACTIVE) LCD_printfxy(9,3,"(off)") |
679 | if(FromCamCtrl.CamStatus & CAM_STATE_REC_ACTIVE) LCD_printfxy(9,3,"(off)") |
680 | else LCD_printfxy(9,3,"(REC)"); // Control only possible if no switch is assigned |
680 | else LCD_printfxy(9,3,"(REC)"); // Control only possible if no switch is assigned |
681 | } |
681 | } |
682 | else LCD_printfxy(2,3,"CH:%3i",127+PPM_In[EE_Parameter.CamCtrlModeChannel]); |
682 | else LCD_printfxy(2,3,"CH:%3i",127+PPM_In[EE_Parameter.CamCtrlModeChannel]); |
683 | 683 | ||
684 | if(Keys & KEY3) |
684 | if(Keys & KEY3) |
685 | { |
685 | { |
686 | ToCamCtrl.CamCommand &= ~(CAM_CMD_REC_OFF|CAM_CMD_REC_ON); |
686 | ToCamCtrl.CamCommand &= ~(CAM_CMD_REC_OFF|CAM_CMD_REC_ON); |
687 | if(FromCamCtrl.CamStatus & CAM_STATE_REC_ACTIVE) ToCamCtrl.CamCommand |= CAM_CMD_REC_OFF; |
687 | if(FromCamCtrl.CamStatus & CAM_STATE_REC_ACTIVE) ToCamCtrl.CamCommand |= CAM_CMD_REC_OFF; |
688 | else ToCamCtrl.CamCommand |= CAM_CMD_REC_ON; |
688 | else ToCamCtrl.CamCommand |= CAM_CMD_REC_ON; |
689 | } |
689 | } |
690 | if(Keys & KEY4) ToCamCtrl.CamCommand |= CAM_CMD_SHUTTER; |
690 | if(Keys & KEY4) ToCamCtrl.CamCommand |= CAM_CMD_SHUTTER; |
691 | //if(Keys & KEY4) ToCamCtrl.CamCommand |= CAM_CMD_RESET_CAM; |
691 | //if(Keys & KEY4) ToCamCtrl.CamCommand |= CAM_CMD_RESET_CAM; |
692 | //if(Keys & KEY4) ToCamCtrl.CamCommand |= CAM_CMD_SWITCH_ON; |
692 | //if(Keys & KEY4) ToCamCtrl.CamCommand |= CAM_CMD_SWITCH_ON; |
693 | //if(Keys & KEY4) ToCamCtrl.CamCommand |= CAM_CMD_SWITCH_OFF; |
693 | //if(Keys & KEY4) ToCamCtrl.CamCommand |= CAM_CMD_SWITCH_OFF; |
694 | } |
694 | } |
695 | else |
695 | else |
696 | { |
696 | { |
697 | if(FromCamCtrl.PPM2Okay) LCD_printfxy(10,3,"PPM:%3i",FromCamCtrl.PPM2Data); |
697 | if(FromCamCtrl.PPM2Okay) LCD_printfxy(10,3,"PPM:%3i",FromCamCtrl.PPM2Data); |
698 | } |
698 | } |
699 | } |
699 | } |
700 | break; |
700 | break; |
701 | 701 | ||
702 | default: |
702 | default: |
703 | //MaxMenuItem = MenuItem - 1; |
703 | //MaxMenuItem = MenuItem - 1; |
704 | MenuItem = 0; |
704 | MenuItem = 0; |
705 | break; |
705 | break; |
706 | } |
706 | } |
707 | } |
707 | } |
708 | 708 |