Browse Source

SITL: add support for multiple i2c buses

zr-v5.1
Peter Barker 5 years ago committed by Peter Barker
parent
commit
69c97c1565
  1. 2
      libraries/SITL/SIM_I2C.cpp
  2. 1
      libraries/SITL/SIM_I2C.h

2
libraries/SITL/SIM_I2C.cpp

@ -94,7 +94,7 @@ int I2C::ioctl_rdwr(i2c_rdwr_ioctl_data *data) @@ -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; // ?!
}
}

1
libraries/SITL/SIM_I2C.h

@ -40,6 +40,7 @@ public: @@ -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;

Loading…
Cancel
Save