Rev 942 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 942 | Rev 957 | ||
---|---|---|---|
1 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2 | // + Copyright (c) 04.2007 Holger Buss |
2 | // + Copyright (c) 04.2007 Holger Buss |
3 | // + only for non-profit use |
3 | // + only for non-profit use |
4 | // + www.MikroKopter.com |
4 | // + www.MikroKopter.com |
5 | // + see the File "License.txt" for further Informations |
5 | // + see the File "License.txt" for further Informations |
6 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
6 | // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
7 | 7 | ||
8 | #include <stdlib.h> |
8 | #include <stdlib.h> |
9 | #include <inttypes.h> |
9 | #include <inttypes.h> |
10 | #include "main.h" |
10 | #include "main.h" |
11 | #include "eeprom.h" |
11 | #include "eeprom.h" |
12 | #include "timer2.h" |
12 | #include "timer2.h" |
13 | #include "fc.h" |
13 | #include "fc.h" |
14 | #include "rc.h" |
14 | #include "rc.h" |
15 | #include "uart.h" |
15 | #include "uart.h" |
16 | #include "printf_P.h" |
16 | #include "printf_P.h" |
17 | #include "analog.h" |
17 | #include "analog.h" |
18 | #ifdef USE_KILLAGREG |
18 | #ifdef USE_KILLAGREG |
19 | #include "mm3.h" |
19 | #include "mm3.h" |
20 | #endif |
20 | #endif |
21 | #if defined (USE_KILLAGREG) || defined (USE_MK3MAG) |
21 | #if (defined (USE_KILLAGREG) || defined (USE_MK3MAG)) |
22 | #include "ubx.h" |
22 | #include "ubx.h" |
23 | #endif |
23 | #endif |
24 | #include "_Settings.h" |
24 | #include "_Settings.h" |
25 | 25 | ||
26 | 26 | ||
27 | #define ARRAYSIZE 10 |
27 | #define ARRAYSIZE 10 |
28 | uint8_t Array[ARRAYSIZE] = {1,2,3,4,5,6,7,8,9,10}; |
28 | uint8_t Array[ARRAYSIZE] = {1,2,3,4,5,6,7,8,9,10}; |
29 | #define DISPLAYBUFFSIZE 80 |
29 | #define DISPLAYBUFFSIZE 80 |
30 | int8_t DisplayBuff[DISPLAYBUFFSIZE] = "Hello World"; |
30 | int8_t DisplayBuff[DISPLAYBUFFSIZE] = "Hello World"; |
31 | uint8_t DispPtr = 0; |
31 | uint8_t DispPtr = 0; |
32 | uint8_t RemoteButtons = 0; |
32 | uint8_t RemoteButtons = 0; |
33 | 33 | ||
34 | #define KEY1 0x01 |
34 | #define KEY1 0x01 |
35 | #define KEY2 0x02 |
35 | #define KEY2 0x02 |
36 | #define KEY3 0x04 |
36 | #define KEY3 0x04 |
37 | #define KEY4 0x08 |
37 | #define KEY4 0x08 |
38 | #define KEY5 0x10 |
38 | #define KEY5 0x10 |
39 | 39 | ||
40 | /************************************/ |
40 | /************************************/ |
41 | /* Clear LCD Buffer */ |
41 | /* Clear LCD Buffer */ |
42 | /************************************/ |
42 | /************************************/ |
43 | void LCD_Clear(void) |
43 | void LCD_Clear(void) |
44 | { |
44 | { |
45 | uint8_t i; |
45 | uint8_t i; |
46 | for( i = 0; i < DISPLAYBUFFSIZE; i++) DisplayBuff[i] = ' '; |
46 | for( i = 0; i < DISPLAYBUFFSIZE; i++) DisplayBuff[i] = ' '; |
47 | } |
47 | } |
48 | 48 | ||
49 | 49 | ||
50 | /************************************/ |
50 | /************************************/ |
51 | /* Update Menu on LCD */ |
51 | /* Update Menu on LCD */ |
52 | /************************************/ |
52 | /************************************/ |
53 | // Display with 20 characters in 4 lines |
53 | // Display with 20 characters in 4 lines |
54 | void LCD_PrintMenu(void) |
54 | void LCD_PrintMenu(void) |
55 | { |
55 | { |
56 | 56 | ||
57 | #if (!defined (USE_KILLAGREG) && !defined (USE_MK3MAG)) |
57 | #if (!defined (USE_KILLAGREG) && !defined (USE_MK3MAG)) |
58 | static uint8_t MaxMenuItem = 11; |
58 | static uint8_t MaxMenuItem = 11; |
59 | #else |
59 | #else |
60 | #ifdef USE_MK3MAG |
60 | #ifdef USE_MK3MAG |
61 | static uint8_t MaxMenuItem = 12; |
61 | static uint8_t MaxMenuItem = 12; |
62 | #endif |
62 | #endif |
63 | #ifdef USE_KILLAGREG |
63 | #ifdef USE_KILLAGREG |
64 | static uint8_t MaxMenuItem = 14; |
64 | static uint8_t MaxMenuItem = 14; |
65 | #endif |
65 | #endif |
66 | #endif |
66 | #endif |
67 | static uint8_t MenuItem=0; |
67 | static uint8_t MenuItem=0; |
68 | 68 | ||
69 | // if KEY1 is activated goto previous menu item |
69 | // if KEY1 is activated goto previous menu item |
70 | if(RemoteButtons & KEY1) |
70 | if(RemoteButtons & KEY1) |
71 | { |
71 | { |
72 | if(MenuItem) MenuItem--; |
72 | if(MenuItem) MenuItem--; |
73 | else MenuItem = MaxMenuItem; |
73 | else MenuItem = MaxMenuItem; |
74 | LCD_Clear(); |
74 | LCD_Clear(); |
75 | RemotePollDisplayLine = -1; |
75 | RemotePollDisplayLine = -1; |
76 | } |
76 | } |
77 | // if KEY2 is activated goto next menu item |
77 | // if KEY2 is activated goto next menu item |
78 | if(RemoteButtons & KEY2) |
78 | if(RemoteButtons & KEY2) |
79 | { |
79 | { |
80 | if (MenuItem == MaxMenuItem) MenuItem = 0; |
80 | if (MenuItem == MaxMenuItem) MenuItem = 0; |
81 | else MenuItem++; |
81 | else MenuItem++; |
82 | LCD_Clear(); |
82 | LCD_Clear(); |
83 | RemotePollDisplayLine = -1; |
83 | RemotePollDisplayLine = -1; |
84 | } |
84 | } |
85 | 85 | ||
86 | // if KEY1 and KEY2 is activated goto initial menu item |
86 | // if KEY1 and KEY2 is activated goto initial menu item |
87 | if((RemoteButtons & KEY1) && (RemoteButtons & KEY2)) MenuItem = 0; |
87 | if((RemoteButtons & KEY1) && (RemoteButtons & KEY2)) MenuItem = 0; |
88 | 88 | ||
89 | // print menu item number in the upper right corner |
89 | // print menu item number in the upper right corner |
90 | if(MenuItem < 10) |
90 | if(MenuItem < 10) |
91 | { |
91 | { |
92 | LCD_printfxy(17,0,"[%i]",MenuItem); |
92 | LCD_printfxy(17,0,"[%i]",MenuItem); |
93 | } |
93 | } |
94 | else |
94 | else |
95 | { |
95 | { |
96 | LCD_printfxy(16,0,"[%i]",MenuItem); |
96 | LCD_printfxy(16,0,"[%i]",MenuItem); |
97 | } |
97 | } |
98 | 98 | ||
99 | switch(MenuItem) |
99 | switch(MenuItem) |
100 | { |
100 | { |
101 | case 0:// Version Info Menu Item |
101 | case 0:// Version Info Menu Item |
102 | LCD_printfxy(0,0,"+ MikroKopter +"); |
102 | LCD_printfxy(0,0,"+ MikroKopter +"); |
103 | LCD_printfxy(0,1,"HW:V%d.%d SW:%d.%d%c",BoardRelease/10,BoardRelease%10,VERSION_MAJOR, VERSION_MINOR,VERSION_INDEX+'a'); |
103 | LCD_printfxy(0,1,"HW:V%d.%d SW:%d.%d%c",BoardRelease/10,BoardRelease%10,VERSION_MAJOR, VERSION_MINOR,VERSION_INDEX+'a'); |
104 | LCD_printfxy(0,2,"Setting: %d ", GetActiveParamSet()); |
104 | LCD_printfxy(0,2,"Setting: %d ", GetActiveParamSet()); |
105 | LCD_printfxy(0,3,"(c) Holger Buss"); |
105 | LCD_printfxy(0,3,"(c) Holger Buss"); |
106 | break; |
106 | break; |
107 | case 1:// Height Control Menu Item |
107 | case 1:// Height Control Menu Item |
108 | if(ParamSet.GlobalConfig & CFG_HEIGHT_CONTROL) |
108 | if(ParamSet.GlobalConfig & CFG_HEIGHT_CONTROL) |
109 | { |
109 | { |
110 | LCD_printfxy(0,0,"Height: %5i",ReadingHeight); |
110 | LCD_printfxy(0,0,"Height: %5i",ReadingHeight); |
111 | LCD_printfxy(0,1,"Set Point: %5i",SetPointHeight); |
111 | LCD_printfxy(0,1,"Set Point: %5i",SetPointHeight); |
112 | LCD_printfxy(0,2,"Air Press.:%5i",ReadingAirPressure); |
112 | LCD_printfxy(0,2,"Air Press.:%5i",ReadingAirPressure); |
113 | LCD_printfxy(0,3,"Offset :%5i",PressureSensorOffset); |
113 | LCD_printfxy(0,3,"Offset :%5i",PressureSensorOffset); |
114 | } |
114 | } |
115 | else |
115 | else |
116 | { |
116 | { |
117 | LCD_printfxy(0,1,"No "); |
117 | LCD_printfxy(0,1,"No "); |
118 | LCD_printfxy(0,2,"Height Control"); |
118 | LCD_printfxy(0,2,"Height Control"); |
119 | } |
119 | } |
120 | 120 | ||
121 | break; |
121 | break; |
122 | case 2:// Attitude Menu Item |
122 | case 2:// Attitude Menu Item |
123 | LCD_printfxy(0,0,"Attitude"); |
123 | LCD_printfxy(0,0,"Attitude"); |
124 | LCD_printfxy(0,1,"Nick: %5i",IntegralNick/1024); |
124 | LCD_printfxy(0,1,"Nick: %5i",IntegralNick/1024); |
125 | LCD_printfxy(0,2,"Roll: %5i",IntegralRoll/1024); |
125 | LCD_printfxy(0,2,"Roll: %5i",IntegralRoll/1024); |
126 | LCD_printfxy(0,3,"Heading: %5i",CompassHeading); |
126 | LCD_printfxy(0,3,"Heading: %5i",CompassHeading); |
127 | break; |
127 | break; |
128 | case 3:// Remote Control Channel Menu Item |
128 | case 3:// Remote Control Channel Menu Item |
129 | LCD_printfxy(0,0,"C1:%4i C2:%4i ",PPM_in[1],PPM_in[2]); |
129 | LCD_printfxy(0,0,"C1:%4i C2:%4i ",PPM_in[1],PPM_in[2]); |
130 | LCD_printfxy(0,1,"C3:%4i C4:%4i ",PPM_in[3],PPM_in[4]); |
130 | LCD_printfxy(0,1,"C3:%4i C4:%4i ",PPM_in[3],PPM_in[4]); |
131 | LCD_printfxy(0,2,"C5:%4i C6:%4i ",PPM_in[5],PPM_in[6]); |
131 | LCD_printfxy(0,2,"C5:%4i C6:%4i ",PPM_in[5],PPM_in[6]); |
132 | LCD_printfxy(0,3,"C7:%4i C8:%4i ",PPM_in[7],PPM_in[8]); |
132 | LCD_printfxy(0,3,"C7:%4i C8:%4i ",PPM_in[7],PPM_in[8]); |
133 | break; |
133 | break; |
134 | case 4:// Remote Control Mapping Menu Item |
134 | case 4:// Remote Control Mapping Menu Item |
135 | LCD_printfxy(0,0,"Ni:%4i Ro:%4i ",PPM_in[ParamSet.ChannelAssignment[CH_NICK]],PPM_in[ParamSet.ChannelAssignment[CH_ROLL]]); |
135 | LCD_printfxy(0,0,"Ni:%4i Ro:%4i ",PPM_in[ParamSet.ChannelAssignment[CH_NICK]],PPM_in[ParamSet.ChannelAssignment[CH_ROLL]]); |
136 | LCD_printfxy(0,1,"Gs:%4i Ya:%4i ",PPM_in[ParamSet.ChannelAssignment[CH_GAS]],PPM_in[ParamSet.ChannelAssignment[CH_YAW]]); |
136 | LCD_printfxy(0,1,"Gs:%4i Ya:%4i ",PPM_in[ParamSet.ChannelAssignment[CH_GAS]],PPM_in[ParamSet.ChannelAssignment[CH_YAW]]); |
137 | LCD_printfxy(0,2,"P1:%4i P2:%4i ",PPM_in[ParamSet.ChannelAssignment[CH_POTI1]],PPM_in[ParamSet.ChannelAssignment[CH_POTI2]]); |
137 | LCD_printfxy(0,2,"P1:%4i P2:%4i ",PPM_in[ParamSet.ChannelAssignment[CH_POTI1]],PPM_in[ParamSet.ChannelAssignment[CH_POTI2]]); |
138 | LCD_printfxy(0,3,"P3:%4i P4:%4i ",PPM_in[ParamSet.ChannelAssignment[CH_POTI3]],PPM_in[ParamSet.ChannelAssignment[CH_POTI4]]); |
138 | LCD_printfxy(0,3,"P3:%4i P4:%4i ",PPM_in[ParamSet.ChannelAssignment[CH_POTI3]],PPM_in[ParamSet.ChannelAssignment[CH_POTI4]]); |
139 | break; |
139 | break; |
140 | case 5:// Gyro Sensor Menu Item |
140 | case 5:// Gyro Sensor Menu Item |
141 | LCD_printfxy(0,0,"Gyro - Sensor"); |
141 | LCD_printfxy(0,0,"Gyro - Sensor"); |
142 | switch(BoardRelease) |
142 | switch(BoardRelease) |
143 | { |
143 | { |
144 | case 10: |
144 | case 10: |
145 | LCD_printfxy(0,1,"Nick %4i (%3i)",AdValueGyrNick - AdNeutralNick, AdNeutralNick); |
145 | LCD_printfxy(0,1,"Nick %4i (%3i)",AdValueGyrNick - AdNeutralNick, AdNeutralNick); |
146 | LCD_printfxy(0,2,"Roll %4i (%3i)",AdValueGyrRoll - AdNeutralRoll, AdNeutralRoll); |
146 | LCD_printfxy(0,2,"Roll %4i (%3i)",AdValueGyrRoll - AdNeutralRoll, AdNeutralRoll); |
147 | LCD_printfxy(0,3,"Yaw %4i (%3i)",AdNeutralYaw - AdValueGyrYaw , AdNeutralYaw); |
147 | LCD_printfxy(0,3,"Yaw %4i (%3i)",AdNeutralYaw - AdValueGyrYaw , AdNeutralYaw); |
148 | break; |
148 | break; |
149 | 149 | ||
150 | case 11: |
150 | case 11: |
151 | LCD_printfxy(0,1,"Nick %4i (%3i)",AdValueGyrNick - AdNeutralNick, AdNeutralNick/2); |
151 | LCD_printfxy(0,1,"Nick %4i (%3i)",AdValueGyrNick - AdNeutralNick, AdNeutralNick/2); |
152 | LCD_printfxy(0,2,"Roll %4i (%3i)",AdValueGyrRoll - AdNeutralRoll, AdNeutralRoll/2); |
152 | LCD_printfxy(0,2,"Roll %4i (%3i)",AdValueGyrRoll - AdNeutralRoll, AdNeutralRoll/2); |
153 | LCD_printfxy(0,3,"Yaw %4i (%3i)",AdNeutralYaw - AdValueGyrYaw , AdNeutralYaw/2); |
153 | LCD_printfxy(0,3,"Yaw %4i (%3i)",AdNeutralYaw - AdValueGyrYaw , AdNeutralYaw/2); |
154 | break; |
154 | break; |
155 | 155 | ||
156 | case 12: |
156 | case 12: |
157 | default: |
157 | default: |
158 | LCD_printfxy(0,1,"Nick %4i (%3i)(%3i)",AdValueGyrNick - AdNeutralNick, AdNeutralNick/2, AnalogOffsetNick); |
158 | LCD_printfxy(0,1,"Nick %4i (%3i)(%3i)",AdValueGyrNick - AdNeutralNick, AdNeutralNick/2, AnalogOffsetNick); |
159 | LCD_printfxy(0,2,"Roll %4i (%3i)(%3i)",AdValueGyrRoll - AdNeutralRoll, AdNeutralRoll/2, AnalogOffsetRoll); |
159 | LCD_printfxy(0,2,"Roll %4i (%3i)(%3i)",AdValueGyrRoll - AdNeutralRoll, AdNeutralRoll/2, AnalogOffsetRoll); |
160 | LCD_printfxy(0,3,"Yaw %4i (%3i)(%3i)",AdNeutralYaw - AdValueGyrYaw , AdNeutralYaw/2 , AnalogOffsetYaw ); |
160 | LCD_printfxy(0,3,"Yaw %4i (%3i)(%3i)",AdNeutralYaw - AdValueGyrYaw , AdNeutralYaw/2 , AnalogOffsetYaw ); |
161 | break; |
161 | break; |
162 | } |
162 | } |
163 | break; |
163 | break; |
164 | case 6:// Acceleration Sensor Menu Item |
164 | case 6:// Acceleration Sensor Menu Item |
165 | LCD_printfxy(0,0,"ACC - Sensor"); |
165 | LCD_printfxy(0,0,"ACC - Sensor"); |
166 | LCD_printfxy(0,1,"Nick %4i (%3i)",AdValueAccNick, NeutralAccX); |
166 | LCD_printfxy(0,1,"Nick %4i (%3i)",AdValueAccNick, NeutralAccX); |
167 | LCD_printfxy(0,2,"Roll %4i (%3i)",AdValueAccRoll, NeutralAccY); |
167 | LCD_printfxy(0,2,"Roll %4i (%3i)",AdValueAccRoll, NeutralAccY); |
168 | LCD_printfxy(0,3,"Height %4i (%3i)",Mean_AccTop, (int)NeutralAccZ); |
168 | LCD_printfxy(0,3,"Height %4i (%3i)",Mean_AccTop, (int)NeutralAccZ); |
169 | break; |
169 | break; |
170 | case 7:// Accumulator Voltage / Remote Control Level |
170 | case 7:// Accumulator Voltage / Remote Control Level |
171 | LCD_printfxy(0,1,"Voltage: %5i",UBat); |
171 | LCD_printfxy(0,1,"Voltage: %5i",UBat); |
172 | LCD_printfxy(0,2,"RC-Level: %5i",RC_Quality); |
172 | LCD_printfxy(0,2,"RC-Level: %5i",RC_Quality); |
173 | break; |
173 | break; |
174 | case 8:// Compass Menu Item |
174 | case 8:// Compass Menu Item |
175 | LCD_printfxy(0,0,"Compass "); |
175 | LCD_printfxy(0,0,"Compass "); |
176 | LCD_printfxy(0,1,"Course: %5i",CompassCourse); |
176 | LCD_printfxy(0,1,"Course: %5i",CompassCourse); |
177 | LCD_printfxy(0,2,"Heading: %5i",CompassHeading); |
177 | LCD_printfxy(0,2,"Heading: %5i",CompassHeading); |
178 | LCD_printfxy(0,3,"OffCourse: %5i",CompassOffCourse); |
178 | LCD_printfxy(0,3,"OffCourse: %5i",CompassOffCourse); |
179 | break; |
179 | break; |
180 | case 9:// Poti Menu Item |
180 | case 9:// Poti Menu Item |
181 | LCD_printfxy(0,0,"Po1: %3i Po5: %3i" ,Poti1,Poti5); //PPM24-Extesion |
181 | LCD_printfxy(0,0,"Po1: %3i Po5: %3i" ,Poti1,Poti5); //PPM24-Extesion |
182 | LCD_printfxy(0,1,"Po2: %3i Po6: %3i" ,Poti2,Poti6); //PPM24-Extesion |
182 | LCD_printfxy(0,1,"Po2: %3i Po6: %3i" ,Poti2,Poti6); //PPM24-Extesion |
183 | LCD_printfxy(0,2,"Po3: %3i Po7: %3i" ,Poti3,Poti7); //PPM24-Extesion |
183 | LCD_printfxy(0,2,"Po3: %3i Po7: %3i" ,Poti3,Poti7); //PPM24-Extesion |
184 | LCD_printfxy(0,3,"Po4: %3i Po8: %3i" ,Poti4,Poti8); //PPM24-Extesion |
184 | LCD_printfxy(0,3,"Po4: %3i Po8: %3i" ,Poti4,Poti8); //PPM24-Extesion |
185 | break; |
185 | break; |
186 | case 10:// Servo Menu Item |
186 | case 10:// Servo Menu Item |
187 | LCD_printfxy(0,0,"Servo " ); |
187 | LCD_printfxy(0,0,"Servo " ); |
188 | LCD_printfxy(0,1,"Setpoint %3i",FCParam.ServoNickControl); |
188 | LCD_printfxy(0,1,"Setpoint %3i",FCParam.ServoNickControl); |
189 | LCD_printfxy(0,2,"Position: %3i",ServoValue); |
189 | LCD_printfxy(0,2,"Position: %3i",ServoValue); |
190 | LCD_printfxy(0,3,"Range:%3i-%3i",ParamSet.ServoNickMin, ParamSet.ServoNickMax); |
190 | LCD_printfxy(0,3,"Range:%3i-%3i",ParamSet.ServoNickMin, ParamSet.ServoNickMax); |
191 | break; |
191 | break; |
192 | case 11://Extern Control |
192 | case 11://Extern Control |
193 | LCD_printfxy(0,0,"ExternControl " ); |
193 | LCD_printfxy(0,0,"ExternControl " ); |
194 | LCD_printfxy(0,1,"Ni:%4i Ro:%4i ",ExternControl.Nick, ExternControl.Roll); |
194 | LCD_printfxy(0,1,"Ni:%4i Ro:%4i ",ExternControl.Nick, ExternControl.Roll); |
195 | LCD_printfxy(0,2,"Gs:%4i Ya:%4i ",ExternControl.Gas, ExternControl.Yaw); |
195 | LCD_printfxy(0,2,"Gs:%4i Ya:%4i ",ExternControl.Gas, ExternControl.Yaw); |
196 | LCD_printfxy(0,3,"Hi:%4i Cf:%4i ",ExternControl.Height, ExternControl.Config); |
196 | LCD_printfxy(0,3,"Hi:%4i Cf:%4i ",ExternControl.Height, ExternControl.Config); |
197 | break; |
197 | break; |
198 | 198 | ||
199 | #if (defined (USE_KILLAGREG) || defined (USE_MK3MAG)) |
199 | #if (defined (USE_KILLAGREG) || defined (USE_MK3MAG)) |
200 | case 12://GPS Lat/Lon coords |
200 | case 12://GPS Lat/Lon coords |
201 | if (GPSInfo.status == INVALID) |
201 | if (GPSInfo.status == INVALID) |
202 | { |
202 | { |
203 | LCD_printfxy(0,0,"No GPS data!"); |
203 | LCD_printfxy(0,0,"No GPS data!"); |
204 | } |
204 | } |
205 | else |
205 | else |
206 | { |
206 | { |
207 | switch (GPSInfo.satfix) |
207 | switch (GPSInfo.satfix) |
208 | { |
208 | { |
209 | case SATFIX_NONE: |
209 | case SATFIX_NONE: |
210 | LCD_printfxy(0,0,"Sats: %d Fix: No", GPSInfo.satnum); |
210 | LCD_printfxy(0,0,"Sats: %d Fix: No", GPSInfo.satnum); |
211 | break; |
211 | break; |
212 | case SATFIX_2D: |
212 | case SATFIX_2D: |
213 | LCD_printfxy(0,0,"Sats: %d Fix: 2D", GPSInfo.satnum); |
213 | LCD_printfxy(0,0,"Sats: %d Fix: 2D", GPSInfo.satnum); |
214 | break; |
214 | break; |
215 | case SATFIX_3D: |
215 | case SATFIX_3D: |
216 | LCD_printfxy(0,0,"Sats: %d Fix: 3D", GPSInfo.satnum); |
216 | LCD_printfxy(0,0,"Sats: %d Fix: 3D", GPSInfo.satnum); |
217 | break; |
217 | break; |
218 | default: |
218 | default: |
219 | LCD_printfxy(0,0,"Sats: %d Fix: ??", GPSInfo.satnum); |
219 | LCD_printfxy(0,0,"Sats: %d Fix: ??", GPSInfo.satnum); |
220 | break; |
220 | break; |
221 | } |
221 | } |
222 | int16_t i1,i2,i3; |
222 | int16_t i1,i2,i3; |
223 | i1 = (int16_t)(GPSInfo.longitude/10000000L); |
223 | i1 = (int16_t)(GPSInfo.longitude/10000000L); |
224 | i2 = abs((int16_t)((GPSInfo.longitude%10000000L)/10000L)); |
224 | i2 = abs((int16_t)((GPSInfo.longitude%10000000L)/10000L)); |
225 | i3 = abs((int16_t)(((GPSInfo.longitude%10000000L)%10000L)/10L)); |
225 | i3 = abs((int16_t)(((GPSInfo.longitude%10000000L)%10000L)/10L)); |
226 | LCD_printfxy(0,1,"Lon: %d.%.3d%.3d deg",i1, i2, i3); |
226 | LCD_printfxy(0,1,"Lon: %d.%.3d%.3d deg",i1, i2, i3); |
227 | i1 = (int16_t)(GPSInfo.latitude/10000000L); |
227 | i1 = (int16_t)(GPSInfo.latitude/10000000L); |
228 | i2 = abs((int16_t)((GPSInfo.latitude%10000000L)/10000L)); |
228 | i2 = abs((int16_t)((GPSInfo.latitude%10000000L)/10000L)); |
229 | i3 = abs((int16_t)(((GPSInfo.latitude%10000000L)%10000L)/10L)); |
229 | i3 = abs((int16_t)(((GPSInfo.latitude%10000000L)%10000L)/10L)); |
230 | LCD_printfxy(0,2,"Lat: %d.%.3d%.3d deg",i1, i2, i3); |
230 | LCD_printfxy(0,2,"Lat: %d.%.3d%.3d deg",i1, i2, i3); |
231 | i1 = (int16_t)(GPSInfo.altitude/1000L); |
231 | i1 = (int16_t)(GPSInfo.altitude/1000L); |
232 | i2 = abs((int16_t)(GPSInfo.altitude%1000L)); |
232 | i2 = abs((int16_t)(GPSInfo.altitude%1000L)); |
233 | LCD_printfxy(0,3,"Alt: %d.%.3d m",i1, i2); |
233 | LCD_printfxy(0,3,"Alt: %d.%.3d m",i1, i2); |
234 | } |
234 | } |
235 | break; |
235 | break; |
236 | #endif |
236 | #endif |
237 | #ifdef USE_KILLAGREG |
237 | #ifdef USE_KILLAGREG |
238 | case 13:// MM3 Kompass |
238 | case 13:// MM3 Kompass |
239 | LCD_printfxy(0,0,"MM3 Offset"); |
239 | LCD_printfxy(0,0,"MM3 Offset"); |
240 | LCD_printfxy(0,1,"X_Offset: %3i",MM3_calib.X_off); |
240 | LCD_printfxy(0,1,"X_Offset: %3i",MM3_calib.X_off); |
241 | LCD_printfxy(0,2,"Y_Offset: %3i",MM3_calib.Y_off); |
241 | LCD_printfxy(0,2,"Y_Offset: %3i",MM3_calib.Y_off); |
242 | LCD_printfxy(0,3,"Z_Offset: %3i",MM3_calib.Z_off); |
242 | LCD_printfxy(0,3,"Z_Offset: %3i",MM3_calib.Z_off); |
243 | break; |
243 | break; |
244 | case 14://MM3 Range |
244 | case 14://MM3 Range |
245 | LCD_printfxy(0,0,"MM3 Range"); |
245 | LCD_printfxy(0,0,"MM3 Range"); |
246 | LCD_printfxy(0,1,"X_Range: %4i",MM3_calib.X_range); |
246 | LCD_printfxy(0,1,"X_Range: %4i",MM3_calib.X_range); |
247 | LCD_printfxy(0,2,"Y_Range: %4i",MM3_calib.Y_range); |
247 | LCD_printfxy(0,2,"Y_Range: %4i",MM3_calib.Y_range); |
248 | LCD_printfxy(0,3,"Z_Range: %4i",MM3_calib.Z_range); |
248 | LCD_printfxy(0,3,"Z_Range: %4i",MM3_calib.Z_range); |
249 | break; |
249 | break; |
250 | #endif |
250 | #endif |
251 | 251 | ||
252 | default: MaxMenuItem = MenuItem - 1; |
252 | default: MaxMenuItem = MenuItem - 1; |
253 | MenuItem = 0; |
253 | MenuItem = 0; |
254 | break; |
254 | break; |
255 | } |
255 | } |
256 | RemoteButtons = 0; |
256 | RemoteButtons = 0; |
257 | } |
257 | } |
258 | 258 |