From 159a5670ce1e94f6e935585e99216f6fda64753b Mon Sep 17 00:00:00 2001 From: terry chen Date: Wed, 25 Sep 2019 23:37:57 +0800 Subject: [PATCH] fix "BIT_GYRO" definition error. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "Register 104" bits 2 to 0 are used to reset the analog and digital signal paths of the gyroscope, accelerometer, and temperature sensors. so that 'BIT_GYRO' should be 0x04 instead of 3. reference: https://www.invensense.com/wp-content/uploads/2015/02/MPU-6000-Register-Map1.pdf @4.27 Register 104 – Signal Path Reset SIGNAL_PATH_RESET Comment and code behavior do not match. The code is set to 2000, but the comment is 1000. --- src/main/drivers/accgyro/accgyro_spi_mpu6000.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/drivers/accgyro/accgyro_spi_mpu6000.c b/src/main/drivers/accgyro/accgyro_spi_mpu6000.c index b16ab6f11d..308be55b53 100644 --- a/src/main/drivers/accgyro/accgyro_spi_mpu6000.c +++ b/src/main/drivers/accgyro/accgyro_spi_mpu6000.c @@ -78,9 +78,9 @@ static void mpu6000AccAndGyroInit(gyroDev_t *gyro); #define BIT_RAW_RDY_EN 0x01 #define BIT_I2C_IF_DIS 0x10 #define BIT_INT_STATUS_DATA 0x01 -#define BIT_GYRO 3 -#define BIT_ACC 2 -#define BIT_TEMP 1 +#define BIT_GYRO 0x04 +#define BIT_ACC 0x02 +#define BIT_TEMP 0x01 // Product ID Description for MPU6000 // high 4 bits low 4 bits @@ -195,7 +195,7 @@ static void mpu6000AccAndGyroInit(gyroDev_t *gyro) spiBusWriteRegister(&gyro->bus, MPU_RA_SMPLRT_DIV, gyro->mpuDividerDrops); delayMicroseconds(15); - // Gyro +/- 1000 DPS Full Scale + // Gyro +/- 2000 DPS Full Scale spiBusWriteRegister(&gyro->bus, MPU_RA_GYRO_CONFIG, INV_FSR_2000DPS << 3); delayMicroseconds(15);