From 9b8f3b6b4c688323a5fa722e5a46a89967d69a65 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 14 May 2023 15:21:19 +0200 Subject: [PATCH] Add command I2CScan0 Add command I2CScan0 to scan both busses if available --- tasmota/tasmota_support/support_command.ino | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tasmota/tasmota_support/support_command.ino b/tasmota/tasmota_support/support_command.ino index c19314725..3f31dddc8 100644 --- a/tasmota/tasmota_support/support_command.ino +++ b/tasmota/tasmota_support/support_command.ino @@ -2567,14 +2567,20 @@ void CmndDnsTimeout(void) { } #ifdef USE_I2C -void CmndI2cScan(void) -{ - if ((1 == XdrvMailbox.index) && (TasmotaGlobal.i2c_enabled)) { - I2cScan(); +void CmndI2cScan(void) { + // I2CScan0 - Scan bus1 and bus2 + // I2CScan - Scan bus1 + // I2CScan2 - Scan bus2 + if (TasmotaGlobal.i2c_enabled) { + if ((0 == XdrvMailbox.index) || (1 == XdrvMailbox.index)) { + I2cScan(); + } } #ifdef ESP32 - if ((2 == XdrvMailbox.index) && (TasmotaGlobal.i2c_enabled_2)) { - I2cScan(1); + if (TasmotaGlobal.i2c_enabled_2) { + if ((0 == XdrvMailbox.index) || (2 == XdrvMailbox.index)) { + I2cScan(1); + } } #endif }