Added MPU9250 ACC detection.

This commit is contained in:
Anders Hoglund 2016-08-09 14:52:22 +02:00
parent 8c3622eb3a
commit 1300952472
3 changed files with 25 additions and 10 deletions

View File

@ -228,7 +228,7 @@ static const char * const sensorTypeNames[] = {
static const char * const sensorHardwareNames[4][11] = {
{ "", "None", "MPU6050", "L3G4200D", "MPU3050", "L3GD20", "MPU6000", "MPU6500", "MPU9250", "FAKE", NULL },
{ "", "None", "ADXL345", "MPU6050", "MMA845x", "BMA280", "LSM303DLHC", "MPU6000", "MPU6500", "FAKE", NULL },
{ "", "None", "ADXL345", "MPU6050", "MMA845x", "BMA280", "LSM303DLHC", "MPU6000", "MPU6500", "MPU9250", "FAKE", NULL },
{ "", "None", "BMP085", "MS5611", "BMP280", NULL },
{ "", "None", "HMC5883", "AK8975", "AK8963", NULL }
};

View File

@ -20,15 +20,16 @@
// Type of accelerometer used/detected
typedef enum {
ACC_DEFAULT = 0,
ACC_NONE = 1,
ACC_ADXL345 = 2,
ACC_MPU6050 = 3,
ACC_MMA8452 = 4,
ACC_BMA280 = 5,
ACC_LSM303DLHC = 6,
ACC_MPU6000 = 7,
ACC_MPU6500 = 8,
ACC_FAKE = 9,
ACC_NONE,
ACC_ADXL345,
ACC_MPU6050,
ACC_MMA8452,
ACC_BMA280,
ACC_LSM303DLHC,
ACC_MPU6000,
ACC_MPU6500,
ACC_MPU9250,
ACC_FAKE,
ACC_MAX = ACC_FAKE
} accelerationSensor_e;

View File

@ -384,6 +384,20 @@ retry:
}
#endif
; // fallthrough
case ACC_MPU9250:
#ifdef USE_ACC_SPI_MPU9250
if (mpu9250SpiAccDetect(&acc))
{
accHardware = ACC_MPU9250;
#ifdef ACC_MPU9250_ALIGN
accAlign = ACC_MPU9250_ALIGN;
#endif
break;
}
#endif
; // fallthrough
case ACC_FAKE:
#ifdef USE_FAKE_ACC
if (fakeAccDetect(&acc)) {