SITL: add support for multiple i2c buses

This commit is contained in:
Peter Barker 2020-08-19 14:57:51 +10:00 committed by Peter Barker
parent bddea9e046
commit 69c97c1565
2 changed files with 2 additions and 1 deletions

View File

@ -94,7 +94,7 @@ int I2C::ioctl_rdwr(i2c_rdwr_ioctl_data *data)
}
}
if (!handled) {
::fprintf(stderr, "Unhandled i2c message: addr=0x%x flags=%u len=%u\n", msg.addr, msg.flags, msg.len);
::fprintf(stderr, "Unhandled i2c message: bus=%u addr=0x%02x flags=%u len=%u\n", msg.bus, msg.addr, msg.flags, msg.len);
return -1; // ?!
}
}

View File

@ -40,6 +40,7 @@ public:
#define I2C_M_RD 1
#define I2C_RDWR 0
struct i2c_msg {
uint8_t bus;
uint8_t addr;
uint8_t flags;
uint8_t *buf;