Rev 2097 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2097 | Rev 2112 | ||
---|---|---|---|
1 | #include <stdlib.h> |
1 | #include <stdlib.h> |
2 | #include <inttypes.h> |
2 | #include <inttypes.h> |
3 | #include "eeprom.h" |
3 | #include "eeprom.h" |
4 | #include "timer2.h" |
4 | #include "timer2.h" |
5 | #include "rc.h" |
5 | #include "rc.h" |
6 | #include "externalControl.h" |
6 | #include "externalControl.h" |
7 | #include "uart0.h" |
7 | #include "uart0.h" |
8 | #include "printf_P.h" |
8 | #include "printf_P.h" |
9 | #include "analog.h" |
9 | #include "analog.h" |
10 | #include "twimaster.h" |
10 | #include "twimaster.h" |
11 | #include "attitude.h" |
11 | #include "attitude.h" |
- | 12 | #include "menu.h" |
|
12 | 13 | ||
13 | #if (!defined (USE_NAVICTRL)) |
14 | #if (!defined (USE_NAVICTRL)) |
14 | uint8_t maxMenuItem = 13; |
15 | uint8_t maxMenuItem = 13; |
15 | #else |
16 | #else |
16 | #ifdef USE_NAVICTRL |
17 | #ifdef USE_NAVICTRL |
17 | #include "gps.c" |
18 | #include "gps.c" |
18 | uint8_t maxMenuItem = 14; |
19 | uint8_t maxMenuItem = 14; |
19 | #endif |
20 | #endif |
20 | #endif |
21 | #endif |
21 | uint8_t menuItem = 0; |
22 | uint8_t menuItem = 0; |
22 | uint8_t remoteKeys = 0; |
23 | uint8_t remoteKeys = 0; |
23 | 24 | ||
24 | #define KEY1 0x01 |
25 | #define KEY1 0x01 |
25 | #define KEY2 0x02 |
26 | #define KEY2 0x02 |
26 | #define KEY3 0x04 |
27 | #define KEY3 0x04 |
27 | #define KEY4 0x08 |
28 | #define KEY4 0x08 |
28 | #define KEY5 0x10 |
29 | #define KEY5 0x10 |
29 | - | ||
30 | #define DISPLAYBUFFSIZE 80 |
30 | |
31 | int8_t displayBuff[DISPLAYBUFFSIZE] = "Hello World"; |
31 | int8_t displayBuff[DISPLAYBUFFSIZE]; |
32 | uint8_t dispPtr = 0; |
32 | uint8_t dispPtr = 0; |
33 | 33 | ||
34 | /************************************/ |
34 | /************************************/ |
35 | /* Clear LCD Buffer */ |
35 | /* Clear LCD Buffer */ |
36 | /************************************/ |
36 | /************************************/ |
37 | void LCD_clear(void) { |
37 | void LCD_clear(void) { |
38 | uint8_t i; |
38 | uint8_t i; |
39 | for (i = 0; i < DISPLAYBUFFSIZE; i++) |
39 | for (i = 0; i < DISPLAYBUFFSIZE; i++) |
40 | displayBuff[i] = ' '; |
40 | displayBuff[i] = ' '; |
41 | } |
41 | } |
42 | 42 | ||
43 | /************************************/ |
43 | /************************************/ |
44 | /* Update Menu on LCD */ |
44 | /* Update Menu on LCD */ |
45 | /************************************/ |
45 | /************************************/ |
46 | // Display with 20 characters in 4 lines |
46 | // Display with 20 characters in 4 lines |
47 | void LCD_printMenu(void) { |
47 | void LCD_printMenu(void) { |
48 | if (remoteKeys & KEY1) { |
48 | if (remoteKeys & KEY1) { |
49 | if (menuItem) |
49 | if (menuItem) |
50 | menuItem--; |
50 | menuItem--; |
51 | else |
51 | else |
52 | menuItem = maxMenuItem; |
52 | menuItem = maxMenuItem; |
53 | } |
53 | } |
54 | 54 | ||
55 | if (remoteKeys & KEY2) { |
55 | if (remoteKeys & KEY2) { |
56 | if (menuItem == maxMenuItem) |
56 | if (menuItem == maxMenuItem) |
57 | menuItem = 0; |
57 | menuItem = 0; |
58 | else |
58 | else |
59 | menuItem++; |
59 | menuItem++; |
60 | } |
60 | } |
61 | if ((remoteKeys & KEY1) && (remoteKeys & KEY2)) |
61 | if ((remoteKeys & KEY1) && (remoteKeys & KEY2)) |
62 | menuItem = 0; |
62 | menuItem = 0; |
63 | 63 | ||
64 | LCD_clear(); |
64 | LCD_clear(); |
65 | 65 | ||
66 | if (menuItem > maxMenuItem) |
66 | if (menuItem > maxMenuItem) |
67 | menuItem = maxMenuItem; |
67 | menuItem = maxMenuItem; |
68 | // print menu item number in the upper right corner |
68 | // print menu item number in the upper right corner |
69 | if (menuItem < 10) { |
69 | if (menuItem < 10) { |
70 | LCD_printfxy(17, 0, "[%i]", menuItem); |
70 | LCD_printfxy(17, 0, "[%i]", menuItem); |
71 | } else { |
71 | } else { |
72 | LCD_printfxy(16, 0, "[%i]", menuItem); |
72 | LCD_printfxy(16, 0, "[%i]", menuItem); |
73 | } |
73 | } |
74 | 74 | ||
75 | switch (menuItem) { |
75 | switch (menuItem) { |
76 | case 0: // Version Info Menu Item |
76 | case 0: // Version Info Menu Item |
77 | LCD_printfxy(0, 0, "+ MikroKopter +"); |
77 | LCD_printfxy(0, 0, "+ MikroKopter +"); |
78 | LCD_printfxy( |
78 | LCD_printfxy( |
79 | 0, |
79 | 0, |
80 | 1, |
80 | 1, |
81 | "HW:V%d.%d SW:%d.%d%c", |
81 | "HW:V%d.%d SW:%d.%d%c", |
82 | boardRelease/10, boardRelease%10, VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH+'a'); |
82 | boardRelease/10, boardRelease%10, VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH+'a'); |
83 | LCD_printfxy(0, 2, "Setting: %d %s", getActiveParamSet(), mixerMatrix.name); |
83 | LCD_printfxy(0, 2, "Setting: %d %s", getActiveParamSet(), mixerMatrix.name); |
84 | if (I2CTimeout < 6) { |
84 | if (I2CTimeout < 6) { |
85 | LCD_printfxy(0, 3, "I2C Error!!!"); |
85 | LCD_printfxy(0, 3, "I2C Error!!!"); |
86 | } else if (missingMotor) { |
86 | } else if (missingMotor) { |
87 | LCD_printfxy(0, 3, "Missing BL-Ctrl:%d", missingMotor); |
87 | LCD_printfxy(0, 3, "Missing BL-Ctrl:%d", missingMotor); |
88 | } else |
88 | } else |
89 | LCD_printfxy(0, 3, "(c) Holger Buss"); |
89 | LCD_printfxy(0, 3, "(c) Holger Buss"); |
90 | break; |
90 | break; |
91 | /* |
91 | /* |
92 | case 1:// Height Control Menu Item |
92 | case 1:// Height Control Menu Item |
93 | if(staticParams.GlobalConfig & CFG_HEIGHT_CONTROL) { |
93 | if(staticParams.GlobalConfig & CFG_HEIGHT_CONTROL) { |
94 | LCD_printfxy(0,0,"Height: %5i",ReadingHeight); |
94 | LCD_printfxy(0,0,"Height: %5i",ReadingHeight); |
95 | LCD_printfxy(0,1,"Set Point: %5i",SetPointHeight); |
95 | LCD_printfxy(0,1,"Set Point: %5i",SetPointHeight); |
96 | LCD_printfxy(0,2,"Air Press.:%5i",0); |
96 | LCD_printfxy(0,2,"Air Press.:%5i",0); |
97 | LCD_printfxy(0,3,"Offset :%5i",0); |
97 | LCD_printfxy(0,3,"Offset :%5i",0); |
98 | } |
98 | } |
99 | else |
99 | else |
100 | { |
100 | { |
101 | LCD_printfxy(0,1,"No "); |
101 | LCD_printfxy(0,1,"No "); |
102 | LCD_printfxy(0,2,"Height Control"); |
102 | LCD_printfxy(0,2,"Height Control"); |
103 | } |
103 | } |
104 | break; |
104 | break; |
105 | */ |
105 | */ |
106 | case 2: // Attitude Menu Item |
106 | case 2: // Attitude Menu Item |
107 | LCD_printfxy(0, 0, "Attitude"); |
107 | LCD_printfxy(0, 0, "Attitude"); |
108 | LCD_printfxy(0, 1, "Nick: %5i", |
108 | LCD_printfxy(0, 1, "Nick: %5i", |
109 | attitude[PITCH] / GYRO_DEG_FACTOR_PITCHROLL); |
109 | attitude[PITCH] / GYRO_DEG_FACTOR_PITCHROLL); |
110 | LCD_printfxy(0, 2, "Roll: %5i", |
110 | LCD_printfxy(0, 2, "Roll: %5i", |
111 | attitude[ROLL ] / GYRO_DEG_FACTOR_PITCHROLL); |
111 | attitude[ROLL ] / GYRO_DEG_FACTOR_PITCHROLL); |
112 | LCD_printfxy(0, 3, "Heading(M):%5i", magneticHeading); |
112 | LCD_printfxy(0, 3, "Heading(M):%5i", magneticHeading); |
113 | break; |
113 | break; |
114 | case 3: // Remote Control Channel Menu Item |
114 | case 3: // Remote Control Channel Menu Item |
115 | LCD_printfxy(0, 0, "C1:%4i C2:%4i ", PPM_in[1], PPM_in[2]); |
115 | LCD_printfxy(0, 0, "C1:%4i C2:%4i ", PPM_in[1], PPM_in[2]); |
116 | LCD_printfxy(0, 1, "C3:%4i C4:%4i ", PPM_in[3], PPM_in[4]); |
116 | LCD_printfxy(0, 1, "C3:%4i C4:%4i ", PPM_in[3], PPM_in[4]); |
117 | LCD_printfxy(0, 2, "C5:%4i C6:%4i ", PPM_in[5], PPM_in[6]); |
117 | LCD_printfxy(0, 2, "C5:%4i C6:%4i ", PPM_in[5], PPM_in[6]); |
118 | LCD_printfxy(0, 3, "C7:%4i C8:%4i ", PPM_in[7], PPM_in[8]); |
118 | LCD_printfxy(0, 3, "C7:%4i C8:%4i ", PPM_in[7], PPM_in[8]); |
119 | break; |
119 | break; |
120 | case 4: // Remote Control Mapping Menu Item |
120 | case 4: // Remote Control Mapping Menu Item |
121 | LCD_printfxy( |
121 | LCD_printfxy( |
122 | 0, |
122 | 0, |
123 | 0, |
123 | 0, |
124 | "Ni:%4i Ro:%4i ", |
124 | "Ni:%4i Ro:%4i ", |
125 | PPM_in[channelMap.channels[CH_PITCH]], PPM_in[channelMap.channels[CH_ROLL]]); |
125 | PPM_in[channelMap.channels[CH_PITCH]], PPM_in[channelMap.channels[CH_ROLL]]); |
126 | LCD_printfxy( |
126 | LCD_printfxy( |
127 | 0, |
127 | 0, |
128 | 1, |
128 | 1, |
129 | "Gs:%4i Ya:%4i ", |
129 | "Gs:%4i Ya:%4i ", |
130 | PPM_in[channelMap.channels[CH_THROTTLE]], PPM_in[channelMap.channels[CH_YAW]]); |
130 | PPM_in[channelMap.channels[CH_THROTTLE]], PPM_in[channelMap.channels[CH_YAW]]); |
131 | LCD_printfxy( |
131 | LCD_printfxy( |
132 | 0, |
132 | 0, |
133 | 2, |
133 | 2, |
134 | "P1:%4i P2:%4i ", |
134 | "P1:%4i P2:%4i ", |
135 | PPM_in[channelMap.channels[CH_POTS]], PPM_in[channelMap.channels[CH_POTS+1]]); |
135 | PPM_in[channelMap.channels[CH_POTS]], PPM_in[channelMap.channels[CH_POTS+1]]); |
136 | LCD_printfxy( |
136 | LCD_printfxy( |
137 | 0, |
137 | 0, |
138 | 3, |
138 | 3, |
139 | "P3:%4i P4:%4i ", |
139 | "P3:%4i P4:%4i ", |
140 | PPM_in[channelMap.channels[CH_POTS+2]], PPM_in[channelMap.channels[CH_POTS+3]]); |
140 | PPM_in[channelMap.channels[CH_POTS+2]], PPM_in[channelMap.channels[CH_POTS+3]]); |
141 | break; |
141 | break; |
142 | /* |
142 | /* |
143 | case 5:// Gyro Sensor Menu Item |
143 | case 5:// Gyro Sensor Menu Item |
144 | LCD_printfxy(0,0,"Gyro - Sensor"); |
144 | LCD_printfxy(0,0,"Gyro - Sensor"); |
145 | switch(BoardRelease) { |
145 | switch(BoardRelease) { |
146 | case 10: |
146 | case 10: |
147 | LCD_printfxy(0,1,"Nick %4i (%3i.%i)", AdValueGyroNick - HiResNickOffset / HIRES_GYRO_AMPLIFY, HiResNickOffset / HIRES_GYRO_AMPLIFY, HiResNickOffset % HIRES_GYRO_AMPLIFY); |
147 | LCD_printfxy(0,1,"Nick %4i (%3i.%i)", AdValueGyroNick - HiResNickOffset / HIRES_GYRO_AMPLIFY, HiResNickOffset / HIRES_GYRO_AMPLIFY, HiResNickOffset % HIRES_GYRO_AMPLIFY); |
148 | LCD_printfxy(0,2,"Roll %4i (%3i.%i)", AdValueGyroRoll - HiResRollOffset / HIRES_GYRO_AMPLIFY, HiResRollOffset / HIRES_GYRO_AMPLIFY, HiResRollOffset % HIRES_GYRO_AMPLIFY); |
148 | LCD_printfxy(0,2,"Roll %4i (%3i.%i)", AdValueGyroRoll - HiResRollOffset / HIRES_GYRO_AMPLIFY, HiResRollOffset / HIRES_GYRO_AMPLIFY, HiResRollOffset % HIRES_GYRO_AMPLIFY); |
149 | LCD_printfxy(0,3,"Yaw %4i (%3i)", AdValueGyroYaw , YawOffset); |
149 | LCD_printfxy(0,3,"Yaw %4i (%3i)", AdValueGyroYaw , YawOffset); |
150 | break; |
150 | break; |
151 | case 11: |
151 | case 11: |
152 | case 12: |
152 | case 12: |
153 | case 20: // divice Offests by 2 becuse 2 samples are added in adc isr |
153 | case 20: // divice Offests by 2 becuse 2 samples are added in adc isr |
154 | LCD_printfxy(0,1,"Nick %4i (%3i.%i)",0, HiResNickOffset / (HIRES_GYRO_AMPLIFY * 2), (HiResNickOffset % (HIRES_GYRO_AMPLIFY * 2)) / 2); // division by 2 to push the reminder below 10 (15/2 = 7) |
154 | LCD_printfxy(0,1,"Nick %4i (%3i.%i)",0, HiResNickOffset / (HIRES_GYRO_AMPLIFY * 2), (HiResNickOffset % (HIRES_GYRO_AMPLIFY * 2)) / 2); // division by 2 to push the reminder below 10 (15/2 = 7) |
155 | LCD_printfxy(0,2,"Roll %4i (%3i.%i)",0, HiResRollOffset / (HIRES_GYRO_AMPLIFY * 2), (HiResRollOffset % (HIRES_GYRO_AMPLIFY * 2)) / 2); // division by 2 to push the reminder below 10 (15/2 = 7) |
155 | LCD_printfxy(0,2,"Roll %4i (%3i.%i)",0, HiResRollOffset / (HIRES_GYRO_AMPLIFY * 2), (HiResRollOffset % (HIRES_GYRO_AMPLIFY * 2)) / 2); // division by 2 to push the reminder below 10 (15/2 = 7) |
156 | LCD_printfxy(0,3,"Yaw %4i (%3i)",YawOffset - AdValueGyroYaw , YawOffset/2); |
156 | LCD_printfxy(0,3,"Yaw %4i (%3i)",YawOffset - AdValueGyroYaw , YawOffset/2); |
157 | break; |
157 | break; |
158 | 158 | ||
159 | case 13: |
159 | case 13: |
160 | default: // divice Offests by 2 becuse 2 samples are added in adc isr |
160 | default: // divice Offests by 2 becuse 2 samples are added in adc isr |
161 | LCD_printfxy(0,1,"Nick %4i (%3i.%i)(%3i)",0, HiResNickOffset / (HIRES_GYRO_AMPLIFY * 2), (HiResNickOffset % (HIRES_GYRO_AMPLIFY * 2))/2, 0); // division by 2 to push the reminder below 10 (15/2 = 7) |
161 | LCD_printfxy(0,1,"Nick %4i (%3i.%i)(%3i)",0, HiResNickOffset / (HIRES_GYRO_AMPLIFY * 2), (HiResNickOffset % (HIRES_GYRO_AMPLIFY * 2))/2, 0); // division by 2 to push the reminder below 10 (15/2 = 7) |
162 | LCD_printfxy(0,2,"Roll %4i (%3i.%i)(%3i)",0, HiResRollOffset / (HIRES_GYRO_AMPLIFY * 2), (HiResRollOffset % (HIRES_GYRO_AMPLIFY * 2))/2, 0); // division by 2 to push the reminder below 10 (15/2 = 7) |
162 | LCD_printfxy(0,2,"Roll %4i (%3i.%i)(%3i)",0, HiResRollOffset / (HIRES_GYRO_AMPLIFY * 2), (HiResRollOffset % (HIRES_GYRO_AMPLIFY * 2))/2, 0); // division by 2 to push the reminder below 10 (15/2 = 7) |
163 | LCD_printfxy(0,3,"Yaw %4i (%3i)(%3i)",YawOffset - AdValueGyroYaw , YawOffset/2, 0); |
163 | LCD_printfxy(0,3,"Yaw %4i (%3i)(%3i)",YawOffset - AdValueGyroYaw , YawOffset/2, 0); |
164 | break; |
164 | break; |
165 | } |
165 | } |
166 | break; |
166 | break; |
167 | case 6:// Acceleration Sensor Menu Item |
167 | case 6:// Acceleration Sensor Menu Item |
168 | LCD_printfxy(0,0,"ACC - Sensor"); |
168 | LCD_printfxy(0,0,"ACC - Sensor"); |
169 | LCD_printfxy(0,1,"Nick %4i (%3i)",0,0); // factor 2 because of adding 2 samples in ADC ISR |
169 | LCD_printfxy(0,1,"Nick %4i (%3i)",0,0); // factor 2 because of adding 2 samples in ADC ISR |
170 | LCD_printfxy(0,2,"Roll %4i (%3i)",0,0); // factor 2 because of adding 2 samples in ADC ISR |
170 | LCD_printfxy(0,2,"Roll %4i (%3i)",0,0); // factor 2 because of adding 2 samples in ADC ISR |
171 | LCD_printfxy(0,3,"Height %4i (%3i)",0,0); |
171 | LCD_printfxy(0,3,"Height %4i (%3i)",0,0); |
172 | break; |
172 | break; |
173 | */ |
173 | */ |
174 | case 7: // Battery Voltage / Remote Control Level |
174 | case 7: // Battery Voltage / Remote Control Level |
175 | LCD_printfxy(0, 1, "Voltage: %3i.%1iV", UBat/10, UBat%10); |
175 | LCD_printfxy(0, 1, "Voltage: %3i.%1iV", UBat/10, UBat%10); |
176 | LCD_printfxy(0, 2, "RC-Level: %5i", RCQuality); |
176 | LCD_printfxy(0, 2, "RC-Level: %5i", RCQuality); |
177 | break; |
177 | break; |
178 | case 8: // Compass Menu Item |
178 | case 8: // Compass Menu Item |
179 | LCD_printfxy(0, 0, "Compass "); |
179 | LCD_printfxy(0, 0, "Compass "); |
180 | LCD_printfxy(0, 0, "TODO: Impl. "); |
180 | LCD_printfxy(0, 0, "TODO: Impl. "); |
181 | break; |
181 | break; |
182 | case 9: // Poti Menu Item |
182 | case 9: // Poti Menu Item |
183 | LCD_printfxy(0, 0, "Variables "); |
183 | LCD_printfxy(0, 0, "Variables "); |
184 | LCD_printfxy(0, 0, "TODO: Impl. "); |
184 | LCD_printfxy(0, 0, "TODO: Impl. "); |
185 | break; |
185 | break; |
186 | case 10: // Servo Menu Item |
186 | case 10: // Servo Menu Item |
187 | LCD_printfxy(0, 0, "Servos "); |
187 | LCD_printfxy(0, 0, "Servos "); |
188 | LCD_printfxy(0, 0, "TODO: Impl. "); |
188 | LCD_printfxy(0, 0, "TODO: Impl. "); |
189 | break; |
189 | break; |
190 | case 11: //Extern Control |
190 | case 11: //Extern Control |
191 | LCD_printfxy(0, 0, "ExternControl "); |
191 | LCD_printfxy(0, 0, "ExternControl "); |
192 | LCD_printfxy(0, 1, "Ni:%4i Ro:%4i ", |
192 | LCD_printfxy(0, 1, "Ni:%4i Ro:%4i ", |
193 | externalControl.pitch, externalControl.roll); |
193 | externalControl.pitch, externalControl.roll); |
194 | LCD_printfxy(0, 2, "Gs:%4i Ya:%4i ", |
194 | LCD_printfxy(0, 2, "Gs:%4i Ya:%4i ", |
195 | externalControl.throttle, externalControl.yaw); |
195 | externalControl.throttle, externalControl.yaw); |
196 | LCD_printfxy(0, 3, "Hi:%4i Cf:%4i ", |
196 | LCD_printfxy(0, 3, "Hi:%4i Cf:%4i ", |
197 | externalControl.height, externalControl.config); |
197 | externalControl.height, externalControl.config); |
198 | break; |
198 | break; |
199 | 199 | ||
200 | case 12: //BL Communication errors |
200 | case 12: //BL Communication errors |
201 | LCD_printfxy(0, 0, "BL-Ctrl Errors "); |
201 | LCD_printfxy(0, 0, "BL-Ctrl Errors "); |
202 | LCD_printfxy(0, 1, " %3d %3d %3d %3d ", |
202 | LCD_printfxy(0, 1, " %3d %3d %3d %3d ", |
203 | motor[0].error, motor[1].error, motor[2].error, motor[3].error); |
203 | motor[0].error, motor[1].error, motor[2].error, motor[3].error); |
204 | LCD_printfxy(0, 2, " %3d %3d %3d %3d ", |
204 | LCD_printfxy(0, 2, " %3d %3d %3d %3d ", |
205 | motor[4].error, motor[5].error, motor[6].error, motor[7].error); |
205 | motor[4].error, motor[5].error, motor[6].error, motor[7].error); |
206 | LCD_printfxy(0, 3, " %3d %3d %3d %3d ", |
206 | LCD_printfxy(0, 3, " %3d %3d %3d %3d ", |
207 | motor[8].error, motor[9].error, motor[10].error, motor[11].error); |
207 | motor[8].error, motor[9].error, motor[10].error, motor[11].error); |
208 | break; |
208 | break; |
209 | 209 | ||
210 | case 13: //BL Overview |
210 | case 13: //BL Overview |
211 | LCD_printfxy(0, 0, "BL-Ctrl found "); |
211 | LCD_printfxy(0, 0, "BL-Ctrl found "); |
212 | LCD_printfxy( |
212 | LCD_printfxy( |
213 | 0, |
213 | 0, |
214 | 1, |
214 | 1, |
215 | " %c %c %c %c ", |
215 | " %c %c %c %c ", |
216 | motor[0].present + '-', motor[1].present + '-', motor[2].present + '-', motor[3].present + '-'); |
216 | motor[0].present + '-', motor[1].present + '-', motor[2].present + '-', motor[3].present + '-'); |
217 | LCD_printfxy( |
217 | LCD_printfxy( |
218 | 0, |
218 | 0, |
219 | 2, |
219 | 2, |
220 | " %c %c %c %c ", |
220 | " %c %c %c %c ", |
221 | motor[4].present + '-', motor[5].present + '-', motor[6].present + '-', motor[7].present + '-'); |
221 | motor[4].present + '-', motor[5].present + '-', motor[6].present + '-', motor[7].present + '-'); |
222 | LCD_printfxy(0, 3, " %c - - - ", motor[8].present + '-'); |
222 | LCD_printfxy(0, 3, " %c - - - ", motor[8].present + '-'); |
223 | if (motor[9].present) |
223 | if (motor[9].present) |
224 | LCD_printfxy(4, 3, "10"); |
224 | LCD_printfxy(4, 3, "10"); |
225 | if (motor[10].present) |
225 | if (motor[10].present) |
226 | LCD_printfxy(8, 3, "11"); |
226 | LCD_printfxy(8, 3, "11"); |
227 | if (motor[11].present) |
227 | if (motor[11].present) |
228 | LCD_printfxy(12, 3, "12"); |
228 | LCD_printfxy(12, 3, "12"); |
229 | break; |
229 | break; |
230 | 230 | ||
231 | #if (defined (USE_NAVICTRL)) |
231 | #if (defined (USE_NAVICTRL)) |
232 | case 14: //GPS Lat/Lon coords |
232 | case 14: //GPS Lat/Lon coords |
233 | if (GPSInfo.status == INVALID) { |
233 | if (GPSInfo.status == INVALID) { |
234 | LCD_printfxy(0,0,"No GPS data!"); |
234 | LCD_printfxy(0,0,"No GPS data!"); |
235 | } else { |
235 | } else { |
236 | switch (GPSInfo.satfix) |
236 | switch (GPSInfo.satfix) |
237 | { |
237 | { |
238 | case SATFIX_NONE: |
238 | case SATFIX_NONE: |
239 | LCD_printfxy(0,0,"Sats: %d Fix: No", GPSInfo.satnum); |
239 | LCD_printfxy(0,0,"Sats: %d Fix: No", GPSInfo.satnum); |
240 | break; |
240 | break; |
241 | case SATFIX_2D: |
241 | case SATFIX_2D: |
242 | LCD_printfxy(0,0,"Sats: %d Fix: 2D", GPSInfo.satnum); |
242 | LCD_printfxy(0,0,"Sats: %d Fix: 2D", GPSInfo.satnum); |
243 | break; |
243 | break; |
244 | case SATFIX_3D: |
244 | case SATFIX_3D: |
245 | LCD_printfxy(0,0,"Sats: %d Fix: 3D", GPSInfo.satnum); |
245 | LCD_printfxy(0,0,"Sats: %d Fix: 3D", GPSInfo.satnum); |
246 | break; |
246 | break; |
247 | default: |
247 | default: |
248 | LCD_printfxy(0,0,"Sats: %d Fix: ??", GPSInfo.satnum); |
248 | LCD_printfxy(0,0,"Sats: %d Fix: ??", GPSInfo.satnum); |
249 | break; |
249 | break; |
250 | } |
250 | } |
251 | int16_t i1,i2,i3; |
251 | int16_t i1,i2,i3; |
252 | i1 = (int16_t)(GPSInfo.longitude/10000000L); |
252 | i1 = (int16_t)(GPSInfo.longitude/10000000L); |
253 | i2 = abs((int16_t)((GPSInfo.longitude%10000000L)/10000L)); |
253 | i2 = abs((int16_t)((GPSInfo.longitude%10000000L)/10000L)); |
254 | i3 = abs((int16_t)(((GPSInfo.longitude%10000000L)%10000L)/10L)); |
254 | i3 = abs((int16_t)(((GPSInfo.longitude%10000000L)%10000L)/10L)); |
255 | LCD_printfxy(0,1,"Lon: %d.%03d%03d deg",i1, i2, i3); |
255 | LCD_printfxy(0,1,"Lon: %d.%03d%03d deg",i1, i2, i3); |
256 | i1 = (int16_t)(GPSInfo.latitude/10000000L); |
256 | i1 = (int16_t)(GPSInfo.latitude/10000000L); |
257 | i2 = abs((int16_t)((GPSInfo.latitude%10000000L)/10000L)); |
257 | i2 = abs((int16_t)((GPSInfo.latitude%10000000L)/10000L)); |
258 | i3 = abs((int16_t)(((GPSInfo.latitude%10000000L)%10000L)/10L)); |
258 | i3 = abs((int16_t)(((GPSInfo.latitude%10000000L)%10000L)/10L)); |
259 | LCD_printfxy(0,2,"Lat: %d.%03d%03d deg",i1, i2, i3); |
259 | LCD_printfxy(0,2,"Lat: %d.%03d%03d deg",i1, i2, i3); |
260 | i1 = (int16_t)(GPSInfo.altitude/1000L); |
260 | i1 = (int16_t)(GPSInfo.altitude/1000L); |
261 | i2 = abs((int16_t)(GPSInfo.altitude%1000L)); |
261 | i2 = abs((int16_t)(GPSInfo.altitude%1000L)); |
262 | LCD_printfxy(0,3,"Alt: %d.%03d m",i1, i2); |
262 | LCD_printfxy(0,3,"Alt: %d.%03d m",i1, i2); |
263 | } |
263 | } |
264 | break; |
264 | break; |
265 | #endif |
265 | #endif |
266 | 266 | ||
267 | default: |
267 | default: |
268 | maxMenuItem = menuItem - 1; |
268 | maxMenuItem = menuItem - 1; |
269 | menuItem = 0; |
269 | menuItem = 0; |
270 | break; |
270 | break; |
271 | } |
271 | } |
272 | remoteKeys = 0; |
272 | remoteKeys = 0; |
273 | } |
273 | } |
274 | 274 |