From 880e9e45ef0556b52158241bfe6ebb861e35828a Mon Sep 17 00:00:00 2001 From: Michael Keller Date: Fri, 16 Oct 2020 03:56:18 +1300 Subject: [PATCH] Make the MPU6050 (I2C) driver only build on Unified Targets with 1MB flash. --- src/main/drivers/accgyro/accgyro_mpu6050.c | 3 +++ src/main/target/STM32_UNIFIED/target.h | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/drivers/accgyro/accgyro_mpu6050.c b/src/main/drivers/accgyro/accgyro_mpu6050.c index 29f51296e..2accb1837 100644 --- a/src/main/drivers/accgyro/accgyro_mpu6050.c +++ b/src/main/drivers/accgyro/accgyro_mpu6050.c @@ -24,6 +24,8 @@ #include "platform.h" +#if defined(USE_ACC_MPU6050) || defined(USE_GYRO_MPU6050) + #include "build/debug.h" #include "common/maths.h" @@ -111,3 +113,4 @@ bool mpu6050GyroDetect(gyroDev_t *gyro) return true; } +#endif diff --git a/src/main/target/STM32_UNIFIED/target.h b/src/main/target/STM32_UNIFIED/target.h index dac82a13c..115193c19 100644 --- a/src/main/target/STM32_UNIFIED/target.h +++ b/src/main/target/STM32_UNIFIED/target.h @@ -155,8 +155,6 @@ #define USE_ACC #define USE_GYRO -#define USE_ACC_MPU6050 -#define USE_GYRO_MPU6050 #define USE_ACC_MPU6500 #define USE_GYRO_MPU6500 #define USE_ACC_SPI_MPU6000 @@ -253,6 +251,9 @@ // Additional drivers included for targets with > 512KB of flash #if (TARGET_FLASH_SIZE > 512) +#define USE_ACC_MPU6050 +#define USE_GYRO_MPU6050 #define USE_ACCGYRO_BMI270 + #define USE_BARO_BMP085 #endif