From e1a05657e2a60e8b12e20c41752320327e8ebaeb Mon Sep 17 00:00:00 2001 From: "H. Utku Maden" Date: Wed, 4 May 2022 10:24:40 +0300 Subject: [PATCH] Fix preprocessor directive mishap causing compilation failure when BMX280_EXPECT_BMP280 set. --- include/bmx280_bits.h | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/include/bmx280_bits.h b/include/bmx280_bits.h index b385afc..7518f69 100644 --- a/include/bmx280_bits.h +++ b/include/bmx280_bits.h @@ -142,26 +142,25 @@ typedef struct bmx280_config_t { #endif #ifndef CONFIG_BMX280_EXPECT_BMP280 -#if (CONFIG_BMX280_DEFAULT_HUMIDITY_OVERSAMPLING_NONE) -#define BMX280_DEFAULT_HUMIDITY_OVERSAMPLING BMX280_HUMIDITY_OVERSAMPLING_NONE -#elif (CONFIG_BMX280_DEFAULT_HUMIDITY_OVERSAMPLING_X1) -#define BMX280_DEFAULT_HUMIDITY_OVERSAMPLING BMX280_HUMIDITY_OVERSAMPLING_X1 -#elif (CONFIG_BMX280_DEFAULT_HUMIDITY_OVERSAMPLING_X2) -#define BMX280_DEFAULT_HUMIDITY_OVERSAMPLING BMX280_HUMIDITY_OVERSAMPLING_X2 -#elif (CONFIG_BMX280_DEFAULT_HUMIDITY_OVERSAMPLING_X4) -#define BMX280_DEFAULT_HUMIDITY_OVERSAMPLING BMX280_HUMIDITY_OVERSAMPLING_X4 -#elif (CONFIG_BMX280_DEFAULT_HUMIDITY_OVERSAMPLING_X8) -#define BMX280_DEFAULT_HUMIDITY_OVERSAMPLING BMX280_HUMIDITY_OVERSAMPLING_X8 -#else -#define BMX280_DEFAULT_HUMIDITY_OVERSAMPLING BMX280_HUMIDITY_OVERSAMPLING_X16 + #if (CONFIG_BMX280_DEFAULT_HUMIDITY_OVERSAMPLING_NONE) + #define BMX280_DEFAULT_HUMIDITY_OVERSAMPLING BMX280_HUMIDITY_OVERSAMPLING_NONE + #elif (CONFIG_BMX280_DEFAULT_HUMIDITY_OVERSAMPLING_X1) + #define BMX280_DEFAULT_HUMIDITY_OVERSAMPLING BMX280_HUMIDITY_OVERSAMPLING_X1 + #elif (CONFIG_BMX280_DEFAULT_HUMIDITY_OVERSAMPLING_X2) + #define BMX280_DEFAULT_HUMIDITY_OVERSAMPLING BMX280_HUMIDITY_OVERSAMPLING_X2 + #elif (CONFIG_BMX280_DEFAULT_HUMIDITY_OVERSAMPLING_X4) + #define BMX280_DEFAULT_HUMIDITY_OVERSAMPLING BMX280_HUMIDITY_OVERSAMPLING_X4 + #elif (CONFIG_BMX280_DEFAULT_HUMIDITY_OVERSAMPLING_X8) + #define BMX280_DEFAULT_HUMIDITY_OVERSAMPLING BMX280_HUMIDITY_OVERSAMPLING_X8 + #else + #define BMX280_DEFAULT_HUMIDITY_OVERSAMPLING BMX280_HUMIDITY_OVERSAMPLING_X16 + #endif #endif #if !(CONFIG_BMX280_EXPECT_BMP280) -#define BMX280_DEFAULT_CONFIG ((bmx280_config_t) { BMX280_DEFAULT_TEMPERATURE_OVERSAMPLING, BMX280_DEFAULT_PRESSURE_OVERSAMPLING, BMX280_DEFAULT_STANDBY, BMX280_DEFAULT_IIR, BMX280_DEFAULT_HUMIDITY_OVERSAMPLING }) + #define BMX280_DEFAULT_CONFIG ((bmx280_config_t) { BMX280_DEFAULT_TEMPERATURE_OVERSAMPLING, BMX280_DEFAULT_PRESSURE_OVERSAMPLING, BMX280_DEFAULT_STANDBY, BMX280_DEFAULT_IIR, BMX280_DEFAULT_HUMIDITY_OVERSAMPLING }) #else -#define BMX280_DEFAULT_CONFIG ((bmx280_config_t) { BMX280_DEFAULT_TEMPERATURE_OVERSAMPLING, BMX280_DEFAULT_PRESSURE_OVERSAMPLING, BMX280_DEFAULT_STANDBY, BMX280_DEFAULT_IIR}) -#endif - + #define BMX280_DEFAULT_CONFIG ((bmx280_config_t) { BMX280_DEFAULT_TEMPERATURE_OVERSAMPLING, BMX280_DEFAULT_PRESSURE_OVERSAMPLING, BMX280_DEFAULT_STANDBY, BMX280_DEFAULT_IIR}) #endif #endif \ No newline at end of file