mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 19:32:36 +08:00
I2CSPIDriverBase: print rotation and i2c address if set
This commit is contained in:
@@ -516,22 +516,37 @@ int I2CSPIDriverBase::module_start(const BusCLIArguments &cli, BusInstanceIterat
|
|||||||
// print some info that we are running
|
// print some info that we are running
|
||||||
switch (iterator.busType()) {
|
switch (iterator.busType()) {
|
||||||
case BOARD_I2C_BUS:
|
case BOARD_I2C_BUS:
|
||||||
PX4_INFO_RAW("%s #%i on I2C bus %d%s\n", instance->ItemName(), runtime_instance, iterator.bus(),
|
PX4_INFO_RAW("%s #%i on I2C bus %d", instance->ItemName(), runtime_instance, iterator.bus());
|
||||||
iterator.external() ? " (external)" : "");
|
|
||||||
|
if (iterator.external()) {
|
||||||
|
PX4_INFO_RAW(" (external)");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cli.i2c_address != 0) {
|
||||||
|
PX4_INFO_RAW(" address 0x%X", cli.i2c_address);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cli.rotation != 0) {
|
||||||
|
PX4_INFO_RAW(" rotation %d", cli.rotation);
|
||||||
|
}
|
||||||
|
|
||||||
|
PX4_INFO_RAW("\n");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BOARD_SPI_BUS:
|
case BOARD_SPI_BUS:
|
||||||
PX4_INFO_RAW("%s #%i on SPI bus %d (devid=0x%x)",
|
PX4_INFO_RAW("%s #%i on SPI bus %d", instance->ItemName(), runtime_instance, iterator.bus());
|
||||||
instance->ItemName(), runtime_instance, iterator.bus(), PX4_SPI_DEV_ID(iterator.devid()));
|
|
||||||
|
|
||||||
if (iterator.external()) {
|
if (iterator.external()) {
|
||||||
PX4_INFO_RAW(" (external, equal to '-b %i')\n", iterator.externalBusIndex());
|
PX4_INFO_RAW(" (external, equal to '-b %i')", iterator.externalBusIndex());
|
||||||
|
|
||||||
} else {
|
|
||||||
PX4_INFO_RAW("\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cli.rotation != 0) {
|
||||||
|
PX4_INFO_RAW(" rotation %d", cli.rotation);
|
||||||
|
}
|
||||||
|
|
||||||
|
PX4_INFO_RAW("\n");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BOARD_INVALID_BUS:
|
case BOARD_INVALID_BUS:
|
||||||
|
|||||||
Reference in New Issue
Block a user