Subversion Repositories FlightCtrl

Rev

Rev 1221 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1221 Rev 1222
Line 56... Line 56...
56
#include "fc.h"
56
#include "fc.h"
57
#include "rc.h"
57
#include "rc.h"
58
#include "uart0.h"
58
#include "uart0.h"
59
#include "printf_P.h"
59
#include "printf_P.h"
60
#include "analog.h"
60
#include "analog.h"
-
 
61
#include "twimaster.h"
Line 61... Line 62...
61
 
62
 
62
#ifdef USE_KILLAGREG
63
#ifdef USE_KILLAGREG
63
#include "mm3.h"
64
#include "mm3.h"
Line 64... Line 65...
64
#endif
65
#endif
65
 
66
 
66
#if (defined (USE_KILLAGREG) || defined (USE_MK3MAG))
67
#if (defined (USE_KILLAGREG) || defined (USE_MK3MAG))
Line 67... Line 68...
67
#include "ubx.h"
68
#include "ubx.h"
68
#endif
69
#endif
69
 
70
 
70
#if (!defined (USE_KILLAGREG) && !defined (USE_MK3MAG))
71
#if (!defined (USE_KILLAGREG) && !defined (USE_MK3MAG))
71
uint8_t MaxMenuItem = 11;
72
uint8_t MaxMenuItem = 13;
72
#else
73
#else
Line 73... Line 74...
73
#ifdef USE_MK3MAG
74
#ifdef USE_MK3MAG
74
uint8_t MaxMenuItem = 12;
75
uint8_t MaxMenuItem = 14;
75
#endif
76
#endif
76
 
77
 
77
#ifdef USE_KILLAGREG
78
#ifdef USE_KILLAGREG
78
uint8_t MaxMenuItem = 14;
79
uint8_t MaxMenuItem = 16;
Line 126... Line 127...
126
 
127
 
127
        if(MenuItem > MaxMenuItem) MenuItem = MaxMenuItem;
128
        if(MenuItem > MaxMenuItem) MenuItem = MaxMenuItem;
128
        // print menu item number in the upper right corner
129
        // print menu item number in the upper right corner
129
        if(MenuItem < 10)
130
        if(MenuItem < 10)
130
        {
131
        {
131
          LCD_printfxy(17,0,"[%i]",MenuItem);
132
                LCD_printfxy(17,0,"[%i]",MenuItem);
132
        }
133
        }
133
        else
134
        else
134
        {
135
        {
135
          LCD_printfxy(16,0,"[%i]",MenuItem);
136
          LCD_printfxy(16,0,"[%i]",MenuItem);
Line 136... Line 137...
136
        }
137
        }
137
 
138
 
138
        switch(MenuItem)
139
        switch(MenuItem)
139
        {
140
        {
140
    case 0:// Version Info Menu Item
141
        case 0:// Version Info Menu Item
141
           LCD_printfxy(0,0,"+ MikroKopter +");
-
 
142
           LCD_printfxy(0,1,"HW:V%d.%d SW:%d.%d%c",BoardRelease/10,BoardRelease%10,VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH+'a');
142
                LCD_printfxy(0,0,"+ MikroKopter +");
143
           #ifndef USE_QUADRO
143
                LCD_printfxy(0,1,"HW:V%d.%d SW:%d.%d%c",BoardRelease/10,BoardRelease%10,VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH+'a');
-
 
144
                LCD_printfxy(0,2,"Setting: %d %s", GetActiveParamSet(), Mixer.Name);
144
                   LCD_printfxy(0,2,"OCTO    Setting: %d ", GetActiveParamSet());
145
                if(I2CTimeout < 6)
-
 
146
                {
145
           #else
147
                        LCD_printfxy(0,3,"I2C Error!!!");
-
 
148
                }
-
 
149
                else if (MissingMotor)
-
 
150
                {
146
           LCD_printfxy(0,2,"QUADRO  Setting: %d ", GetActiveParamSet());
151
                        LCD_printfxy(0,3,"Missing BL-Ctrl:%d", MissingMotor);
147
           #endif
152
                }
148
           LCD_printfxy(0,3,"(c) Holger Buss");
153
                else LCD_printfxy(0,3,"(c) Holger Buss");
149
           break;
154
                break;
150
    case 1:// Height Control Menu Item
155
        case 1:// Height Control Menu Item
151
          if(ParamSet.GlobalConfig & CFG_HEIGHT_CONTROL)
156
                if(ParamSet.GlobalConfig & CFG_HEIGHT_CONTROL)
152
           {
157
                {
153
           LCD_printfxy(0,0,"Height:    %5i",ReadingHeight);
158
                        LCD_printfxy(0,0,"Height:    %5i",ReadingHeight);
154
           LCD_printfxy(0,1,"Set Point: %5i",SetPointHeight);
159
                        LCD_printfxy(0,1,"Set Point: %5i",SetPointHeight);
155
           LCD_printfxy(0,2,"Air Press.:%5i",ReadingAirPressure);
160
                        LCD_printfxy(0,2,"Air Press.:%5i",ReadingAirPressure);
156
           LCD_printfxy(0,3,"Offset    :%5i",PressureSensorOffset);
161
                        LCD_printfxy(0,3,"Offset    :%5i",PressureSensorOffset);
157
           }
162
                }
158
           else
163
                else
159
           {
164
                {
-
 
165
                        LCD_printfxy(0,1,"No ");
160
           LCD_printfxy(0,1,"No ");
166
                        LCD_printfxy(0,2,"Height Control");
161
           LCD_printfxy(0,2,"Height Control");
167
                }
162
           }
-
 
163
 
168
                break;
164
           break;
169
 
165
    case 2:// Attitude Menu Item
170
        case 2:// Attitude Menu Item
166
           LCD_printfxy(0,0,"Attitude");
171
                LCD_printfxy(0,0,"Attitude");
167
           LCD_printfxy(0,1,"Nick:      %5i",IntegralGyroNick/1024);
172
                LCD_printfxy(0,1,"Nick:      %5i",IntegralGyroNick/1024);
168
           LCD_printfxy(0,2,"Roll:      %5i",IntegralGyroRoll/1024);
173
                LCD_printfxy(0,2,"Roll:      %5i",IntegralGyroRoll/1024);
169
           LCD_printfxy(0,3,"Heading:   %5i",CompassHeading);
174
                LCD_printfxy(0,3,"Heading:   %5i",CompassHeading);
170
           break;
175
                break;
171
    case 3:// Remote Control Channel Menu Item
176
        case 3:// Remote Control Channel Menu Item
172
           LCD_printfxy(0,0,"C1:%4i  C2:%4i ",PPM_in[1],PPM_in[2]);
177
                LCD_printfxy(0,0,"C1:%4i  C2:%4i ",PPM_in[1],PPM_in[2]);
173
           LCD_printfxy(0,1,"C3:%4i  C4:%4i ",PPM_in[3],PPM_in[4]);
178
                LCD_printfxy(0,1,"C3:%4i  C4:%4i ",PPM_in[3],PPM_in[4]);
174
           LCD_printfxy(0,2,"C5:%4i  C6:%4i ",PPM_in[5],PPM_in[6]);
179
                LCD_printfxy(0,2,"C5:%4i  C6:%4i ",PPM_in[5],PPM_in[6]);
175
           LCD_printfxy(0,3,"C7:%4i  C8:%4i ",PPM_in[7],PPM_in[8]);
180
                LCD_printfxy(0,3,"C7:%4i  C8:%4i ",PPM_in[7],PPM_in[8]);
176
           break;
181
                break;
177
    case 4:// Remote Control Mapping Menu Item
182
        case 4:// Remote Control Mapping Menu Item
178
           LCD_printfxy(0,0,"Ni:%4i  Ro:%4i ",PPM_in[ParamSet.ChannelAssignment[CH_NICK]],PPM_in[ParamSet.ChannelAssignment[CH_ROLL]]);
183
                LCD_printfxy(0,0,"Ni:%4i  Ro:%4i ",PPM_in[ParamSet.ChannelAssignment[CH_NICK]],PPM_in[ParamSet.ChannelAssignment[CH_ROLL]]);
179
           LCD_printfxy(0,1,"Gs:%4i  Ya:%4i ",PPM_in[ParamSet.ChannelAssignment[CH_GAS]],PPM_in[ParamSet.ChannelAssignment[CH_YAW]]);
184
                LCD_printfxy(0,1,"Gs:%4i  Ya:%4i ",PPM_in[ParamSet.ChannelAssignment[CH_GAS]],PPM_in[ParamSet.ChannelAssignment[CH_YAW]]);
180
           LCD_printfxy(0,2,"P1:%4i  P2:%4i ",PPM_in[ParamSet.ChannelAssignment[CH_POTI1]],PPM_in[ParamSet.ChannelAssignment[CH_POTI2]]);
185
                LCD_printfxy(0,2,"P1:%4i  P2:%4i ",PPM_in[ParamSet.ChannelAssignment[CH_POTI1]],PPM_in[ParamSet.ChannelAssignment[CH_POTI2]]);
181
           LCD_printfxy(0,3,"P3:%4i  P4:%4i ",PPM_in[ParamSet.ChannelAssignment[CH_POTI3]],PPM_in[ParamSet.ChannelAssignment[CH_POTI4]]);
186
                LCD_printfxy(0,3,"P3:%4i  P4:%4i ",PPM_in[ParamSet.ChannelAssignment[CH_POTI3]],PPM_in[ParamSet.ChannelAssignment[CH_POTI4]]);
182
           break;
187
                break;
183
        case 5:// Gyro Sensor Menu Item
188
        case 5:// Gyro Sensor Menu Item
184
           LCD_printfxy(0,0,"Gyro - Sensor");
189
                LCD_printfxy(0,0,"Gyro - Sensor");
185
           switch(BoardRelease)
190
                switch(BoardRelease)
186
           {
191
                {
187
                        case 10:
192
                case 10:
188
                           LCD_printfxy(0,1,"Nick %4i (%3i.%i)",AdValueGyroNick - BiasHiResGyroNick / HIRES_GYRO_AMPLIFY, BiasHiResGyroNick / HIRES_GYRO_AMPLIFY, BiasHiResGyroNick % HIRES_GYRO_AMPLIFY);
193
                LCD_printfxy(0,1,"Nick %4i (%3i.%i)",AdValueGyroNick - BiasHiResGyroNick / HIRES_GYRO_AMPLIFY, BiasHiResGyroNick / HIRES_GYRO_AMPLIFY, BiasHiResGyroNick % HIRES_GYRO_AMPLIFY);
189
                           LCD_printfxy(0,2,"Roll %4i (%3i.%i)",AdValueGyroRoll - BiasHiResGyroRoll / HIRES_GYRO_AMPLIFY, BiasHiResGyroRoll / HIRES_GYRO_AMPLIFY, BiasHiResGyroRoll % HIRES_GYRO_AMPLIFY);
194
                LCD_printfxy(0,2,"Roll %4i (%3i.%i)",AdValueGyroRoll - BiasHiResGyroRoll / HIRES_GYRO_AMPLIFY, BiasHiResGyroRoll / HIRES_GYRO_AMPLIFY, BiasHiResGyroRoll % HIRES_GYRO_AMPLIFY);
190
                           LCD_printfxy(0,3,"Yaw  %4i (%3i)",AdBiasGyroYaw  - AdValueGyroYaw , AdBiasGyroYaw);
195
                LCD_printfxy(0,3,"Yaw  %4i (%3i)",AdBiasGyroYaw  - AdValueGyroYaw , AdBiasGyroYaw);
191
                           break;
196
                break;
192
 
197
 
193
                        case 11:
198
                case 11:
194
                        case 12:
199
                case 12:
195
                        case 20: // divice Offests by 2 becuse 2 samples are added in adc isr
200
                case 20: // divice Offests by 2 becuse 2 samples are added in adc isr
196
                           LCD_printfxy(0,1,"Nick %4i (%3i.%i)",AdValueGyroNick - BiasHiResGyroNick/HIRES_GYRO_AMPLIFY, BiasHiResGyroNick / (HIRES_GYRO_AMPLIFY * 2), (BiasHiResGyroNick % (HIRES_GYRO_AMPLIFY * 2)) / 2); // division by 2 to push the reminder below 10 (15/2 = 7)
201
                        LCD_printfxy(0,1,"Nick %4i (%3i.%i)",AdValueGyroNick - BiasHiResGyroNick/HIRES_GYRO_AMPLIFY, BiasHiResGyroNick / (HIRES_GYRO_AMPLIFY * 2), (BiasHiResGyroNick % (HIRES_GYRO_AMPLIFY * 2)) / 2); // division by 2 to push the reminder below 10 (15/2 = 7)
197
                           LCD_printfxy(0,2,"Roll %4i (%3i.%i)",AdValueGyroRoll - BiasHiResGyroRoll/HIRES_GYRO_AMPLIFY, BiasHiResGyroRoll / (HIRES_GYRO_AMPLIFY * 2), (BiasHiResGyroRoll % (HIRES_GYRO_AMPLIFY * 2)) / 2); // division by 2 to push the reminder below 10 (15/2 = 7)
-
 
198
                           LCD_printfxy(0,3,"Yaw  %4i (%3i)",AdBiasGyroYaw  - AdValueGyroYaw , AdBiasGyroYaw/2);
-
 
199
                           break;
-
 
200
 
-
 
201
                        case 13:
-
 
202
                        default: // divice Offests by 2 becuse 2 samples are added in adc isr
202
                        LCD_printfxy(0,2,"Roll %4i (%3i.%i)",AdValueGyroRoll - BiasHiResGyroRoll/HIRES_GYRO_AMPLIFY, BiasHiResGyroRoll / (HIRES_GYRO_AMPLIFY * 2), (BiasHiResGyroRoll % (HIRES_GYRO_AMPLIFY * 2)) / 2); // division by 2 to push the reminder below 10 (15/2 = 7)
203
                           LCD_printfxy(0,1,"Nick %4i (%3i.%i)(%3i)",AdValueGyroNick - BiasHiResGyroNick/HIRES_GYRO_AMPLIFY, BiasHiResGyroNick / (HIRES_GYRO_AMPLIFY * 2), (BiasHiResGyroNick % (HIRES_GYRO_AMPLIFY * 2))/2, DacOffsetGyroNick); // division by 2 to push the reminder below 10 (15/2 = 7)
-
 
204
                           LCD_printfxy(0,2,"Roll %4i (%3i.%i)(%3i)",AdValueGyroRoll - BiasHiResGyroRoll/HIRES_GYRO_AMPLIFY, BiasHiResGyroRoll / (HIRES_GYRO_AMPLIFY * 2), (BiasHiResGyroRoll % (HIRES_GYRO_AMPLIFY * 2))/2, DacOffsetGyroRoll); // division by 2 to push the reminder below 10 (15/2 = 7)
-
 
205
                           LCD_printfxy(0,3,"Yaw  %4i (%3i)(%3i)",AdBiasGyroYaw  - AdValueGyroYaw , AdBiasGyroYaw/2, DacOffsetGyroYaw );
-
 
206
                           break;
-
 
207
          }
-
 
208
          break;
-
 
209
    case 6:// Acceleration Sensor Menu Item
-
 
210
           LCD_printfxy(0,0,"ACC - Sensor");
-
 
211
           LCD_printfxy(0,1,"Nick   %4i (%3i)",AdValueAccNick/2, AdBiasAccNick/2); // factor 2 because of adding 2 samples in ADC ISR
-
 
212
           LCD_printfxy(0,2,"Roll   %4i (%3i)",AdValueAccRoll/2, AdBiasAccRoll/2); // factor 2 because of adding 2 samples in ADC ISR
-
 
213
           LCD_printfxy(0,3,"Height %4i (%3i)",AdValueAccTop, (int16_t)AdBiasAccTop);
-
 
214
           break;
-
 
215
    case 7:// Accumulator Voltage / Remote Control Level
-
 
216
           LCD_printfxy(0,1,"Voltage:  %3i.%1iV",UBat/10, UBat%10);
-
 
217
           LCD_printfxy(0,2,"RC-Level: %5i",RC_Quality);
-
 
218
           break;
-
 
219
    case 8:// Compass Menu Item
-
 
220
           LCD_printfxy(0,0,"Compass       ");
-
 
221
           LCD_printfxy(0,1,"Course:    %5i",CompassCourse);
-
 
222
           LCD_printfxy(0,2,"Heading:   %5i",CompassHeading);
-
 
223
           LCD_printfxy(0,3,"OffCourse: %5i",CompassOffCourse);
-
 
224
           break;
-
 
225
    case 9:// Poti Menu Item
-
 
226
                   LCD_printfxy(0,0,"Po1: %3i Po5: %3i" ,Poti1,Poti5); //PPM24-Extesion
-
 
227
                   LCD_printfxy(0,1,"Po2: %3i Po6: %3i" ,Poti2,Poti6); //PPM24-Extesion
-
 
228
                   LCD_printfxy(0,2,"Po3: %3i Po7: %3i" ,Poti3,Poti7); //PPM24-Extesion
-
 
229
                   LCD_printfxy(0,3,"Po4: %3i Po8: %3i" ,Poti4,Poti8); //PPM24-Extesion
-
 
230
           break;
-
 
231
    case 10:// Servo Menu Item
-
 
232
           LCD_printfxy(0,0,"Servo  " );
-
 
233
           LCD_printfxy(0,1,"Setpoint  %3i",FCParam.ServoNickControl);
-
 
234
           LCD_printfxy(0,2,"Position: %3i",ServoNickValue);
-
 
235
           LCD_printfxy(0,3,"Range:%3i-%3i",ParamSet.ServoNickMin, ParamSet.ServoNickMax);
-
 
236
           break;
-
 
237
    case 11://Extern Control
-
 
238
           LCD_printfxy(0,0,"ExternControl  " );
-
 
239
           LCD_printfxy(0,1,"Ni:%4i  Ro:%4i ",ExternControl.Nick, ExternControl.Roll);
-
 
240
           LCD_printfxy(0,2,"Gs:%4i  Ya:%4i ",ExternControl.Gas, ExternControl.Yaw);
-
 
Line -... Line 203...
-
 
203
                        LCD_printfxy(0,3,"Yaw  %4i (%3i)",AdBiasGyroYaw  - AdValueGyroYaw , AdBiasGyroYaw/2);
-
 
204
                        break;
-
 
205
 
-
 
206
                case 13:
-
 
207
                default: // divice Offests by 2 becuse 2 samples are added in adc isr
-
 
208
                        LCD_printfxy(0,1,"Nick %4i (%3i.%i)(%3i)",AdValueGyroNick - BiasHiResGyroNick/HIRES_GYRO_AMPLIFY, BiasHiResGyroNick / (HIRES_GYRO_AMPLIFY * 2), (BiasHiResGyroNick % (HIRES_GYRO_AMPLIFY * 2))/2, DacOffsetGyroNick); // division by 2 to push the reminder below 10 (15/2 = 7)
-
 
209
                        LCD_printfxy(0,2,"Roll %4i (%3i.%i)(%3i)",AdValueGyroRoll - BiasHiResGyroRoll/HIRES_GYRO_AMPLIFY, BiasHiResGyroRoll / (HIRES_GYRO_AMPLIFY * 2), (BiasHiResGyroRoll % (HIRES_GYRO_AMPLIFY * 2))/2, DacOffsetGyroRoll); // division by 2 to push the reminder below 10 (15/2 = 7)
-
 
210
                        LCD_printfxy(0,3,"Yaw  %4i (%3i)(%3i)",AdBiasGyroYaw  - AdValueGyroYaw , AdBiasGyroYaw/2, DacOffsetGyroYaw );
-
 
211
                        break;
-
 
212
                }
-
 
213
                break;
-
 
214
        case 6:// Acceleration Sensor Menu Item
-
 
215
                LCD_printfxy(0,0,"ACC - Sensor");
-
 
216
                LCD_printfxy(0,1,"Nick   %4i (%3i)",AdValueAccNick/2, AdBiasAccNick/2); // factor 2 because of adding 2 samples in ADC ISR
-
 
217
                LCD_printfxy(0,2,"Roll   %4i (%3i)",AdValueAccRoll/2, AdBiasAccRoll/2); // factor 2 because of adding 2 samples in ADC ISR
-
 
218
                LCD_printfxy(0,3,"Height %4i (%3i)",AdValueAccTop, (int16_t)AdBiasAccTop);
-
 
219
                break;
-
 
220
        case 7:// Accumulator Voltage / Remote Control Level
-
 
221
                LCD_printfxy(0,1,"Voltage:  %3i.%1iV",UBat/10, UBat%10);
-
 
222
                LCD_printfxy(0,2,"RC-Level: %5i",RC_Quality);
-
 
223
                break;
-
 
224
        case 8:// Compass Menu Item
-
 
225
                LCD_printfxy(0,0,"Compass       ");
-
 
226
                LCD_printfxy(0,1,"Course:    %5i",CompassCourse);
-
 
227
                LCD_printfxy(0,2,"Heading:   %5i",CompassHeading);
-
 
228
                LCD_printfxy(0,3,"OffCourse: %5i",CompassOffCourse);
-
 
229
                break;
-
 
230
        case 9:// Poti Menu Item
-
 
231
                LCD_printfxy(0,0,"Po1: %3i Po5: %3i" ,Poti1,Poti5); //PPM24-Extesion
-
 
232
                LCD_printfxy(0,1,"Po2: %3i Po6: %3i" ,Poti2,Poti6); //PPM24-Extesion
-
 
233
                LCD_printfxy(0,2,"Po3: %3i Po7: %3i" ,Poti3,Poti7); //PPM24-Extesion
-
 
234
                LCD_printfxy(0,3,"Po4: %3i Po8: %3i" ,Poti4,Poti8); //PPM24-Extesion
-
 
235
                break;
-
 
236
        case 10:// Servo Menu Item
-
 
237
                LCD_printfxy(0,0,"Servo  " );
-
 
238
                LCD_printfxy(0,1,"Setpoint  %3i",FCParam.ServoNickControl);
-
 
239
                LCD_printfxy(0,2,"Position: %3i",ServoNickValue);
-
 
240
                LCD_printfxy(0,3,"Range:%3i-%3i",ParamSet.ServoNickMin, ParamSet.ServoNickMax);
-
 
241
                break;
-
 
242
        case 11://Extern Control
-
 
243
                LCD_printfxy(0,0,"ExternControl  " );
-
 
244
                LCD_printfxy(0,1,"Ni:%4i  Ro:%4i ",ExternControl.Nick, ExternControl.Roll);
-
 
245
                LCD_printfxy(0,2,"Gs:%4i  Ya:%4i ",ExternControl.Gas, ExternControl.Yaw);
-
 
246
                LCD_printfxy(0,3,"Hi:%4i  Cf:%4i ",ExternControl.Height, ExternControl.Config);
-
 
247
                break;
-
 
248
 
-
 
249
        case 12://BL Communication errors
-
 
250
                LCD_printfxy(0,0,"BL-Ctrl Errors " );
-
 
251
                LCD_printfxy(0,1," %3d  %3d  %3d  %3d ",Motor[0].Error,Motor[1].Error,Motor[2].Error,Motor[3].Error);
-
 
252
                LCD_printfxy(0,2," %3d  %3d  %3d  %3d ",Motor[4].Error,Motor[5].Error,Motor[6].Error,Motor[7].Error);
-
 
253
                LCD_printfxy(0,3," %3d  %3d  %3d  %3d ",Motor[8].Error,Motor[9].Error,Motor[10].Error,Motor[11].Error);
-
 
254
                break;
-
 
255
 
-
 
256
        case 13://BL Overview
-
 
257
                LCD_printfxy(0,0,"BL-Ctrl found " );
-
 
258
                LCD_printfxy(0,1," %c   %c   %c   %c ",Motor[0].Present + '-',Motor[1].Present + '-',Motor[2].Present + '-',Motor[3].Present + '-');
-
 
259
                LCD_printfxy(0,2," %c   %c   %c   %c ",Motor[4].Present + '-',Motor[5].Present + '-',Motor[6].Present + '-',Motor[7].Present + '-');
-
 
260
                LCD_printfxy(0,3," %c   -   -   - ",Motor[8].Present + '-');
-
 
261
                if(Motor[9].Present)  LCD_printfxy(4,3,"10");
-
 
262
                if(Motor[10].Present) LCD_printfxy(8,3,"11");
241
           LCD_printfxy(0,3,"Hi:%4i  Cf:%4i ",ExternControl.Height, ExternControl.Config);
263
                if(Motor[11].Present) LCD_printfxy(12,3,"12");
242
           break;
264
                break;
243
 
265
 
244
    #if (defined (USE_KILLAGREG) || defined (USE_MK3MAG))
266
        #if (defined (USE_KILLAGREG) || defined (USE_MK3MAG))
245
        case 12://GPS Lat/Lon coords
267
        case 14://GPS Lat/Lon coords
246
                        if (GPSInfo.status == INVALID)
268
                        if (GPSInfo.status == INVALID)
247
                        {
269
                        {
Line 266... Line 288...
266
                                }
288
                                }
267
                                int16_t i1,i2,i3;
289
                                int16_t i1,i2,i3;
268
                                i1 = (int16_t)(GPSInfo.longitude/10000000L);
290
                                i1 = (int16_t)(GPSInfo.longitude/10000000L);
269
                                i2 = abs((int16_t)((GPSInfo.longitude%10000000L)/10000L));
291
                                i2 = abs((int16_t)((GPSInfo.longitude%10000000L)/10000L));
270
                                i3 = abs((int16_t)(((GPSInfo.longitude%10000000L)%10000L)/10L));
292
                                i3 = abs((int16_t)(((GPSInfo.longitude%10000000L)%10000L)/10L));
271
                                LCD_printfxy(0,1,"Lon: %d.%.3d%.3d deg",i1, i2, i3);
293
                                LCD_printfxy(0,1,"Lon: %d.%03d%03d deg",i1, i2, i3);
272
                                i1 = (int16_t)(GPSInfo.latitude/10000000L);
294
                                i1 = (int16_t)(GPSInfo.latitude/10000000L);
273
                                i2 = abs((int16_t)((GPSInfo.latitude%10000000L)/10000L));
295
                                i2 = abs((int16_t)((GPSInfo.latitude%10000000L)/10000L));
274
                                i3 = abs((int16_t)(((GPSInfo.latitude%10000000L)%10000L)/10L));
296
                                i3 = abs((int16_t)(((GPSInfo.latitude%10000000L)%10000L)/10L));
275
                                LCD_printfxy(0,2,"Lat: %d.%.3d%.3d deg",i1, i2, i3);
297
                                LCD_printfxy(0,2,"Lat: %d.%03d%03d deg",i1, i2, i3);
276
                                i1 = (int16_t)(GPSInfo.altitude/1000L);
298
                                i1 = (int16_t)(GPSInfo.altitude/1000L);
277
                                i2 = abs((int16_t)(GPSInfo.altitude%1000L));
299
                                i2 = abs((int16_t)(GPSInfo.altitude%1000L));
278
                                LCD_printfxy(0,3,"Alt: %d.%.3d m",i1, i2);
300
                                LCD_printfxy(0,3,"Alt: %d.%03d m",i1, i2);
279
                        }
301
                        }
280
                        break;
302
                        break;
281
        #endif
303
        #endif
282
        #ifdef USE_KILLAGREG
304
        #ifdef USE_KILLAGREG
283
        case 13:// MM3 Kompass
305
        case 15:// MM3 Kompass
284
                        LCD_printfxy(0,0,"MM3 Offset");
306
                        LCD_printfxy(0,0,"MM3 Offset");
285
                        LCD_printfxy(0,1,"X_Offset:  %3i",MM3_calib.X_off);
307
                        LCD_printfxy(0,1,"X_Offset:  %3i",MM3_calib.X_off);
286
                        LCD_printfxy(0,2,"Y_Offset:  %3i",MM3_calib.Y_off);
308
                        LCD_printfxy(0,2,"Y_Offset:  %3i",MM3_calib.Y_off);
287
                        LCD_printfxy(0,3,"Z_Offset:  %3i",MM3_calib.Z_off);
309
                        LCD_printfxy(0,3,"Z_Offset:  %3i",MM3_calib.Z_off);
288
                        break;
310
                        break;
289
        case 14://MM3 Range
311
        case 16://MM3 Range
290
                        LCD_printfxy(0,0,"MM3 Range");
312
                        LCD_printfxy(0,0,"MM3 Range");
291
                        LCD_printfxy(0,1,"X_Range:  %4i",MM3_calib.X_range);
313
                        LCD_printfxy(0,1,"X_Range:  %4i",MM3_calib.X_range);
292
                        LCD_printfxy(0,2,"Y_Range:  %4i",MM3_calib.Y_range);
314
                        LCD_printfxy(0,2,"Y_Range:  %4i",MM3_calib.Y_range);
293
                        LCD_printfxy(0,3,"Z_Range:  %4i",MM3_calib.Z_range);
315
                        LCD_printfxy(0,3,"Z_Range:  %4i",MM3_calib.Z_range);
294
                        break;
316
                        break;
295
        #endif
317
        #endif
Line -... Line 318...
-
 
318
 
296
 
319
        default:
297
    default: MaxMenuItem = MenuItem - 1;
320
                MaxMenuItem = MenuItem - 1;
298
             MenuItem = 0;
321
                MenuItem = 0;
299
           break;
322
                break;
300
    }
323
        }
301
    RemoteKeys = 0;
324
        RemoteKeys = 0;