From 5d2fb24bc19abb639ac45345e446fa9d09e6709f Mon Sep 17 00:00:00 2001 From: Marcelo Bezerra <23555060+mmosca@users.noreply.github.com> Date: Tue, 23 Jul 2024 12:05:49 +0200 Subject: [PATCH] Add DEFAULT_I2C_BUS and make sure we default to a valid i2c bus --- src/main/target/common_post.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/target/common_post.h b/src/main/target/common_post.h index fc3859977..fddd8b2a9 100644 --- a/src/main/target/common_post.h +++ b/src/main/target/common_post.h @@ -56,11 +56,13 @@ extern uint8_t __config_end; // Temperature sensors #if !defined(TEMPERATURE_I2C_BUS) && defined(DEFAULT_I2C_BUS) - #define TEMPERATURE_I2C_BUS DEFAULT_I2C_BUS - #endif +// Rangefinder sensors +#if !defined(RANGEFINDER_I2C_BUS) && defined(DEFAULT_I2C_BUS) +#define RANGEFINDER_I2C_BUS DEFAULT_I2C_BUS +#endif // Enable MSP_DISPLAYPORT for F3 targets without builtin OSD, // since it's used to display CMS on MWOSD @@ -100,6 +102,10 @@ extern uint8_t __config_end; #endif // USE_MAG_ALL +#if defined(DEFAULT_I2C_BUS) && !defined(MAG_I2C_BUS) +#define MAG_I2C_BUS DEFAULT_I2C_BUS +#endif + #endif // USE_MAG #if defined(USE_BARO) @@ -117,6 +123,10 @@ extern uint8_t __config_end; #define USE_BARO_SPL06 #endif +#if defined(DEFAULT_I2C_BUS) && !defined(BARO_I2C_BUS) +#define BARO_I2C_BUS DEFAULT_I2C_BUS +#endif + #endif #ifdef USE_ESC_SENSOR -- 2.11.4.GIT