From 5791aea3fc3ad8c6e2c6a20277619b0125e80c67 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sat, 17 Jun 2023 12:54:48 +1000 Subject: [PATCH] SITL: correct compilation when AP_SIM_IS31FL3195_ENABLED off object won't exist in that case --- libraries/SITL/SIM_I2C.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/SITL/SIM_I2C.cpp b/libraries/SITL/SIM_I2C.cpp index 1f8f76413a..40152ab7fe 100644 --- a/libraries/SITL/SIM_I2C.cpp +++ b/libraries/SITL/SIM_I2C.cpp @@ -117,8 +117,10 @@ void I2C::init() i.device.init(); } +#if AP_SIM_IS31FL3195_ENABLED // IS31FL3195 needs to know its own address: is31fl3195.set_product_id(SIM_IS31FL3195_ADDR); +#endif // sanity check the i2c_devices structure to ensure we don't have // two devices at the same address on the same bus: