1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-26 01:35:41 +03:00

Relocate and use some of the common MPU code from MPU6000 into

accgyro_mpu.c.
This commit is contained in:
Dominic Clifton 2015-09-19 17:11:04 +01:00
parent 0361d161fb
commit 678c0413cb
10 changed files with 98 additions and 126 deletions

View file

@ -37,6 +37,7 @@
#include "accgyro.h"
#include "accgyro_mpu3050.h"
#include "accgyro_mpu6050.h"
#include "accgyro_spi_mpu6000.h"
#include "accgyro_spi_mpu6500.h"
#include "accgyro_mpu.h"
@ -139,10 +140,22 @@ static bool detectSPISensorsAndUpdateDetectionResult(void)
mpuConfiguration.gyroReadXRegister = MPU6500_RA_GYRO_XOUT_H;
mpuConfiguration.read = mpu6500ReadRegister;
mpuConfiguration.write = mpu6500WriteRegister;
return true;
}
#endif
return found;
#ifdef USE_GYRO_SPI_MPU6000
found = mpu6000SpiDetect();
if (found) {
mpuDetectionResult.sensor = MPU_60x0_SPI;
mpuConfiguration.gyroReadXRegister = MPU6000_GYRO_XOUT_H;
mpuConfiguration.read = mpu6000ReadRegister;
mpuConfiguration.write = mpu6000WriteRegister;
return true;
}
#endif
return false;
}
#endif