From 741dee6d6ddf07a224b3bcd6fef1073612686a5e Mon Sep 17 00:00:00 2001 From: nathan Date: Sun, 10 Jul 2016 20:34:42 -0700 Subject: [PATCH] preprocessor defines for spi mpu6000 and spi bmp280, check for the button feature, not specific targets --- src/main/drivers/accgyro_spi_mpu6000.c | 5 +++++ src/main/drivers/barometer_spi_bmp280.c | 2 ++ src/main/main.c | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/drivers/accgyro_spi_mpu6000.c b/src/main/drivers/accgyro_spi_mpu6000.c index 8c277dea5c..cb565b6430 100644 --- a/src/main/drivers/accgyro_spi_mpu6000.c +++ b/src/main/drivers/accgyro_spi_mpu6000.c @@ -41,6 +41,9 @@ #include "sensor.h" #include "accgyro.h" #include "accgyro_mpu.h" + +#if defined(USE_GYRO_SPI_MPU6000) || defined(USE_ACC_SPI_MPU6000) + #include "accgyro_spi_mpu6000.h" static void mpu6000AccAndGyroInit(void); @@ -283,3 +286,5 @@ bool mpu6000SpiGyroDetect(gyro_t *gyro) return true; } + +#endif diff --git a/src/main/drivers/barometer_spi_bmp280.c b/src/main/drivers/barometer_spi_bmp280.c index d7a7491959..23b1cbf87e 100644 --- a/src/main/drivers/barometer_spi_bmp280.c +++ b/src/main/drivers/barometer_spi_bmp280.c @@ -28,6 +28,7 @@ #include "barometer.h" #include "barometer_bmp280.h" +#ifdef USE_BARO_SPI_BMP280 #define DISABLE_BMP280 IOHi(bmp280CsPin) #define ENABLE_BMP280 IOLo(bmp280CsPin) @@ -91,3 +92,4 @@ void bmp280_spi_get_up(void) bmp280_up = (int32_t)((((uint32_t)(data[0])) << 12) | (((uint32_t)(data[1])) << 4) | ((uint32_t)data[2] >> 4)); bmp280_ut = (int32_t)((((uint32_t)(data[3])) << 12) | (((uint32_t)(data[4])) << 4) | ((uint32_t)data[5] >> 4)); } +#endif diff --git a/src/main/main.c b/src/main/main.c index a411117617..8cf45ac7bb 100644 --- a/src/main/main.c +++ b/src/main/main.c @@ -193,7 +193,7 @@ void init(void) EXTIInit(); #endif -#if defined(SPRACINGF3MINI) || defined(OMNIBUS) +#if defined(BUTTONS) gpio_config_t buttonAGpioConfig = { BUTTON_A_PIN, Mode_IPU,