From f9ee4198e11f0f2ec32a2c04ad23402bbf28cf62 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Fri, 11 Oct 2024 12:38:04 +0200 Subject: [PATCH] Fix compile error when wire1 is unavailable --- tasmota/tasmota_support/support_a_i2c.ino | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tasmota/tasmota_support/support_a_i2c.ino b/tasmota/tasmota_support/support_a_i2c.ino index 0af7450d6..c857240cd 100644 --- a/tasmota/tasmota_support/support_a_i2c.ino +++ b/tasmota/tasmota_support/support_a_i2c.ino @@ -63,7 +63,12 @@ bool I2cBegin(int sda, int scl, uint32_t bus, uint32_t frequency) { #endif // USE_I2C_BUS2_ESP8266 #endif // ESP8266 #ifdef ESP32 +#ifdef USE_I2C_BUS2 TwoWire& myWire = (0 == bus) ? Wire : Wire1; +#else + if (bus > 0) { return false; } + TwoWire& myWire = Wire; +#endif static bool reinit = false; if (reinit) { myWire.end(); } result = myWire.begin(sda, scl, frequency);