mirror of https://github.com/arendst/Tasmota.git
Add command I2CScan0
Add command I2CScan0 to scan both busses if available
This commit is contained in:
parent
f1a9a0b45b
commit
9b8f3b6b4c
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue