|
|
|
@ -746,23 +746,6 @@ namespace teraranger
@@ -746,23 +746,6 @@ namespace teraranger
|
|
|
|
|
|
|
|
|
|
TERARANGER *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])) |
|
|
|
|
|
|
|
|
|
int start(uint8_t rotation); |
|
|
|
|
int start_bus(uint8_t rotation, int i2c_bus); |
|
|
|
|
int stop(); |
|
|
|
@ -787,8 +770,8 @@ start(uint8_t rotation)
@@ -787,8 +770,8 @@ start(uint8_t rotation)
|
|
|
|
|
return PX4_ERROR; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (unsigned i = 0; i < NUM_BUS_OPTIONS; i++) { |
|
|
|
|
if (start_bus(rotation, bus_options[i]) == PX4_OK) { |
|
|
|
|
for (unsigned i = 0; i < NUM_I2C_BUS_OPTIONS; i++) { |
|
|
|
|
if (start_bus(rotation, i2c_bus_options[i]) == PX4_OK) { |
|
|
|
|
return PX4_OK; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -849,7 +832,6 @@ fail:
@@ -849,7 +832,6 @@ fail:
|
|
|
|
|
g_dev = nullptr; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
PX4_ERR("not started on bus %d", i2c_bus); |
|
|
|
|
return PX4_ERROR; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|