Subversion Repositories NaviCtrl

Rev

Rev 711 | Rev 767 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 711 Rev 743
Line 1183... Line 1183...
1183
//UART1_PutString(msg);
1183
//UART1_PutString(msg);
1184
        if(NCMAG_Identification2.Sub == MAG_IDF_LSM303D)        
1184
        if(NCMAG_Identification2.Sub == MAG_IDF_LSM303D)        
1185
         {
1185
         {
1186
                NCMAG_SensorType = TYPE_LSM303D;
1186
                NCMAG_SensorType = TYPE_LSM303D;
1187
                NCMAG_ConfigureSensor();
1187
                NCMAG_ConfigureSensor();
-
 
1188
                NCMAG_Compass_use_Orientation = 1;
1188
                retval = 1;
1189
                retval = 1;
1189
         }
1190
         }
1190
        else
1191
        else
1191
         {      // External Sensor not LSM303D
1192
         {      // External Sensor not LSM303D
1192
                for(repeat = 0; repeat < 3; repeat++)  // does it have ACC?
1193
                for(repeat = 0; repeat < 3; repeat++)  // does it have ACC?
Line 1197... Line 1198...
1197
                }
1198
                }
1198
                // Extenal sensor not found?
1199
                // Extenal sensor not found?
1199
                if(!retval)
1200
                if(!retval)
1200
                {
1201
                {
1201
                        // search internal sensor afterwards
1202
                        // search internal sensor afterwards
-
 
1203
                        if(UART_VersionInfo.HWMajor >= 30)
-
 
1204
                        {
1202
                        if(UART_VersionInfo.HWMajor >= 30) UART1_PutString(" main I2C-Bus ");
1205
                          UART1_PutString(" main I2C-Bus ");
-
 
1206
                          NCMAG_Compass_use_Orientation = 1;
-
 
1207
                         }
-
 
1208
                        else
-
 
1209
                         {
1203
                        else UART1_PutString(" internal sensor ");
1210
                          UART1_PutString(" internal sensor ");
-
 
1211
                          NCMAG_Compass_use_Orientation = 0;
-
 
1212
                         }
1204
                        Compass_I2CPort = NCMAG_PORT_INTERN;
1213
                        Compass_I2CPort = NCMAG_PORT_INTERN;
1205
                }
1214
                }
1206
                else
1215
                else
1207
                {
1216
                {
1208
                        UART1_PutString(" external sensor ");
1217
                        UART1_PutString(" external sensor ");
1209
                        Compass_I2CPort = NCMAG_PORT_EXTERN;
1218
                        Compass_I2CPort = NCMAG_PORT_EXTERN;
-
 
1219
                        NCMAG_Compass_use_Orientation = 1;
1210
                }
1220
                }
1211
                //-------------------------------------------
1221
                //-------------------------------------------
1212
                NCMAG_Present = 0;
1222
                NCMAG_Present = 0;
1213
                NCMAG_SensorType = TYPE_HMC5843;        // assuming having an HMC5843
1223
                NCMAG_SensorType = TYPE_HMC5843;        // assuming having an HMC5843
Line 1314... Line 1324...
1314
                                                {
1324
                                                {
1315
                                                        if(NCMAG_Orientation != Calibration.Version >> 4)
1325
                                                        if(NCMAG_Orientation != Calibration.Version >> 4)
1316
                                                        {
1326
                                                        {
1317
                                                                sprintf(msg, "\n\r Warning: calibrated orientation was %d !",Calibration.Version >> 4);
1327
                                                                sprintf(msg, "\n\r Warning: calibrated orientation was %d !",Calibration.Version >> 4);
1318
                                                                UART1_PutString(msg);
1328
                                                                UART1_PutString(msg);
-
 
1329
//NCMAG_IsCalibrated = 0; // force new calibration!
1319
                                                        }
1330
                                                        }
1320
                                                }
1331
                                                }
1321
                                        }
1332
                                        }
1322
                                        else
1333
                                        else
1323
                                        {
1334
                                        {