diff --git a/src/drivers/differential_pressure/ets/ets_airspeed.cpp b/src/drivers/differential_pressure/ets/ets_airspeed.cpp index a9c022658d..5929ab82ac 100644 --- a/src/drivers/differential_pressure/ets/ets_airspeed.cpp +++ b/src/drivers/differential_pressure/ets/ets_airspeed.cpp @@ -237,24 +237,7 @@ ETSAirspeed::cycle() namespace ets_airspeed { -ETSAirspeed *g_dev; - -int bus_options[] = { -#ifdef PX4_I2C_BUS_EXPANSION - PX4_I2C_BUS_EXPANSION, -#endif -#ifdef PX4_I2C_BUS_EXPANSION1 - PX4_I2C_BUS_EXPANSION1, -#endif -#ifdef PX4_I2C_BUS_EXPANSION2 - PX4_I2C_BUS_EXPANSION2, -#endif -#ifdef PX4_I2C_BUS_ONBOARD - PX4_I2C_BUS_ONBOARD, -#endif -}; - -#define NUM_BUS_OPTIONS (sizeof(bus_options)/sizeof(bus_options[0])) +ETSAirspeed *g_dev = nullptr; int start(); int start_bus(int i2c_bus); @@ -273,8 +256,8 @@ int info(); int start() { - for (unsigned i = 0; i < NUM_BUS_OPTIONS; i++) { - if (start_bus(bus_options[i]) == PX4_OK) { + for (unsigned i = 0; i < NUM_I2C_BUS_OPTIONS; i++) { + if (start_bus(i2c_bus_options[i]) == PX4_OK) { return PX4_OK; } } @@ -330,8 +313,6 @@ fail: g_dev = nullptr; } - PX4_WARN("not started on bus %d", i2c_bus); - return PX4_ERROR; } diff --git a/src/drivers/differential_pressure/ms4525/ms4525_airspeed.cpp b/src/drivers/differential_pressure/ms4525/ms4525_airspeed.cpp index 575740d917..3fe7856aa0 100644 --- a/src/drivers/differential_pressure/ms4525/ms4525_airspeed.cpp +++ b/src/drivers/differential_pressure/ms4525/ms4525_airspeed.cpp @@ -374,23 +374,6 @@ namespace meas_airspeed MEASAirspeed *g_dev = nullptr; -int bus_options[] = { -#ifdef PX4_I2C_BUS_EXPANSION - PX4_I2C_BUS_EXPANSION, -#endif -#ifdef PX4_I2C_BUS_EXPANSION1 - PX4_I2C_BUS_EXPANSION1, -#endif -#ifdef PX4_I2C_BUS_EXPANSION2 - PX4_I2C_BUS_EXPANSION2, -#endif -#ifdef PX4_I2C_BUS_ONBOARD - PX4_I2C_BUS_ONBOARD, -#endif -}; - -#define NUM_BUS_OPTIONS (sizeof(bus_options)/sizeof(bus_options[0])) - int start(); int start_bus(int i2c_bus); int stop(); @@ -407,8 +390,8 @@ int reset(); int start() { - for (unsigned i = 0; i < NUM_BUS_OPTIONS; i++) { - if (start_bus(bus_options[i]) == PX4_OK) { + for (unsigned i = 0; i < NUM_I2C_BUS_OPTIONS; i++) { + if (start_bus(i2c_bus_options[i]) == PX4_OK) { return PX4_OK; } } @@ -465,8 +448,6 @@ fail: g_dev = nullptr; } - PX4_WARN("not started on bus %d", i2c_bus); - return PX4_ERROR; } diff --git a/src/drivers/differential_pressure/ms5525/MS5525_main.cpp b/src/drivers/differential_pressure/ms5525/MS5525_main.cpp index b0cf644e7b..b718a7f585 100644 --- a/src/drivers/differential_pressure/ms5525/MS5525_main.cpp +++ b/src/drivers/differential_pressure/ms5525/MS5525_main.cpp @@ -43,23 +43,6 @@ namespace ms5525_airspeed { MS5525 *g_dev = nullptr; -int bus_options[] = { -#ifdef PX4_I2C_BUS_EXPANSION - PX4_I2C_BUS_EXPANSION, -#endif -#ifdef PX4_I2C_BUS_EXPANSION1 - PX4_I2C_BUS_EXPANSION1, -#endif -#ifdef PX4_I2C_BUS_EXPANSION2 - PX4_I2C_BUS_EXPANSION2, -#endif -#ifdef PX4_I2C_BUS_ONBOARD - PX4_I2C_BUS_ONBOARD, -#endif -}; - -#define NUM_BUS_OPTIONS (sizeof(bus_options)/sizeof(bus_options[0])) - int start(); int start_bus(uint8_t i2c_bus); int stop(); @@ -76,8 +59,8 @@ int reset(); int start() { - for (unsigned i = 0; i < NUM_BUS_OPTIONS; i++) { - if (start_bus(bus_options[i]) == PX4_OK) { + for (unsigned i = 0; i < NUM_I2C_BUS_OPTIONS; i++) { + if (start_bus(i2c_bus_options[i]) == PX4_OK) { return PX4_OK; } } @@ -133,8 +116,6 @@ fail: g_dev = nullptr; } - PX4_WARN("not started on bus %d", i2c_bus); - return PX4_ERROR; } diff --git a/src/drivers/differential_pressure/sdp3x/SDP3X_main.cpp b/src/drivers/differential_pressure/sdp3x/SDP3X_main.cpp index 39844fce8f..f6b65b0847 100644 --- a/src/drivers/differential_pressure/sdp3x/SDP3X_main.cpp +++ b/src/drivers/differential_pressure/sdp3x/SDP3X_main.cpp @@ -42,23 +42,6 @@ namespace sdp3x_airspeed { SDP3X *g_dev = nullptr; -int bus_options[] = { -#ifdef PX4_I2C_BUS_EXPANSION - PX4_I2C_BUS_EXPANSION, -#endif -#ifdef PX4_I2C_BUS_EXPANSION1 - PX4_I2C_BUS_EXPANSION1, -#endif -#ifdef PX4_I2C_BUS_EXPANSION2 - PX4_I2C_BUS_EXPANSION2, -#endif -#ifdef PX4_I2C_BUS_ONBOARD - PX4_I2C_BUS_ONBOARD, -#endif -}; - -#define NUM_BUS_OPTIONS (sizeof(bus_options)/sizeof(bus_options[0])) - int start(); int start_bus(uint8_t i2c_bus); int stop(); @@ -75,8 +58,8 @@ int reset(); int start() { - for (unsigned i = 0; i < NUM_BUS_OPTIONS; i++) { - if (start_bus(bus_options[i]) == PX4_OK) { + for (unsigned i = 0; i < NUM_I2C_BUS_OPTIONS; i++) { + if (start_bus(i2c_bus_options[i]) == PX4_OK) { return PX4_OK; } } @@ -145,8 +128,6 @@ fail: g_dev = nullptr; } - PX4_WARN("not started on bus %d", i2c_bus); - return PX4_ERROR; }