Add command I2CScan0

Add command I2CScan0 to scan both busses if available
This commit is contained in:
Theo Arends 2023-05-14 15:21:19 +02:00
parent f1a9a0b45b
commit 9b8f3b6b4c
1 changed files with 12 additions and 6 deletions

View File

@ -2567,15 +2567,21 @@ void CmndDnsTimeout(void) {
}
#ifdef USE_I2C
void CmndI2cScan(void)
{
if ((1 == XdrvMailbox.index) && (TasmotaGlobal.i2c_enabled)) {
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)) {
if (TasmotaGlobal.i2c_enabled_2) {
if ((0 == XdrvMailbox.index) || (2 == XdrvMailbox.index)) {
I2cScan(1);
}
}
#endif
}