1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-23 00:05:28 +03:00

Fix for dection of ACC_MPU9250 (#554)

This commit is contained in:
Martin Budden 2016-09-04 01:35:44 +01:00 committed by Konstantin Sharlaimov
parent 945ad52f9b
commit d6d9d9198a
4 changed files with 17 additions and 7 deletions

View file

@ -231,7 +231,7 @@ static const char * const sensorTypeNames[] = {
// sync with gyroSensor_e // sync with gyroSensor_e
static const char * const gyroNames[] = { "", "None", "MPU6050", "L3G4200D", "MPU3050", "L3GD20", "MPU6000", "MPU6500", "MPU9250", "FAKE"}; static const char * const gyroNames[] = { "", "None", "MPU6050", "L3G4200D", "MPU3050", "L3GD20", "MPU6000", "MPU6500", "MPU9250", "FAKE"};
// sync with accelerationSensor_e // sync with accelerationSensor_e
static const char * const accNames[] = { "None", "", "ADXL345", "MPU6050", "MMA845x", "BMA280", "LSM303DLHC", "MPU6000", "MPU6500", "FAKE"}; static const char * const accNames[] = { "None", "", "ADXL345", "MPU6050", "MMA845x", "BMA280", "LSM303DLHC", "MPU6000", "MPU6500", "MPU9250", "FAKE"};
// sync with baroSensor_e // sync with baroSensor_e
static const char * const baroNames[] = { "", "None", "BMP085", "MS5611", "BMP280", "FAKE"}; static const char * const baroNames[] = { "", "None", "BMP085", "MS5611", "BMP280", "FAKE"};
// sync with magSensor_e // sync with magSensor_e

View file

@ -28,7 +28,8 @@ typedef enum {
ACC_LSM303DLHC = 6, ACC_LSM303DLHC = 6,
ACC_MPU6000 = 7, ACC_MPU6000 = 7,
ACC_MPU6500 = 8, ACC_MPU6500 = 8,
ACC_FAKE = 9, ACC_MPU9250 = 9,
ACC_FAKE = 10,
ACC_MAX = ACC_FAKE ACC_MAX = ACC_FAKE
} accelerationSensor_e; } accelerationSensor_e;

View file

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

View file

@ -45,14 +45,14 @@
#define MPU9250_CS_PIN PC4 #define MPU9250_CS_PIN PC4
#define MPU9250_SPI_INSTANCE SPI1 #define MPU9250_SPI_INSTANCE SPI1
#define ACC
#define USE_ACC_SPI_MPU9250
#define ACC_MPU9250_ALIGN CW270_DEG
#define GYRO #define GYRO
#define USE_GYRO_SPI_MPU9250 #define USE_GYRO_SPI_MPU9250
#define GYRO_MPU9250_ALIGN CW270_DEG #define GYRO_MPU9250_ALIGN CW270_DEG
#define ACC
#define USE_ACC_SPI_MPU9250
#define ACC_MPU9250_ALIGN CW270_DEG
#define MAG #define MAG
#define USE_MAG_AK8963 #define USE_MAG_AK8963
#define USE_MAG_AK8975 #define USE_MAG_AK8975