diff --git a/libraries/SITL/SIM_I2C.cpp b/libraries/SITL/SIM_I2C.cpp index 9670d368ff..247e34036d 100644 --- a/libraries/SITL/SIM_I2C.cpp +++ b/libraries/SITL/SIM_I2C.cpp @@ -70,6 +70,19 @@ void I2C::init() for (auto &i : i2c_devices) { i.device.init(); } + + // sanity check the i2c_devices structure to ensure we don't have + // two devices at the same address on the same bus: + for (uint8_t i=0; i