mirror of https://github.com/arendst/Tasmota.git
i2c: I2cSetDevice wrong behavior
Most drivers do not expect address blocking after calling i2cSetDevice. I2cSetActive removed from I2cSetDevice. All drivers waiting for this call are fixed. refs #7556
This commit is contained in:
parent
6c83787210
commit
e03a14ce21
|
@ -1521,11 +1521,7 @@ bool I2cSetDevice(uint32_t addr)
|
||||||
return false; // If already active report as not present;
|
return false; // If already active report as not present;
|
||||||
}
|
}
|
||||||
Wire.beginTransmission((uint8_t)addr);
|
Wire.beginTransmission((uint8_t)addr);
|
||||||
bool result = (0 == Wire.endTransmission());
|
return (0 == Wire.endTransmission());
|
||||||
if (result) {
|
|
||||||
I2cSetActive(addr, 1);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
#endif // USE_I2C
|
#endif // USE_I2C
|
||||||
|
|
||||||
|
|
|
@ -4775,6 +4775,7 @@ bool Xdrv10(uint8_t function)
|
||||||
glob_script_mem.script_pram_size=MAX_SCRIPT_SIZE;
|
glob_script_mem.script_pram_size=MAX_SCRIPT_SIZE;
|
||||||
|
|
||||||
glob_script_mem.flags=1;
|
glob_script_mem.flags=1;
|
||||||
|
I2cSetActiveFound(EEPROM_ADDRESS, "EEPROM");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -116,6 +116,7 @@ void ILI9488_InitDriver()
|
||||||
if (I2cEnabled(XI2C_38) && I2cSetDevice(FT6236_address)) {
|
if (I2cEnabled(XI2C_38) && I2cSetDevice(FT6236_address)) {
|
||||||
FT6236begin(FT6236_address);
|
FT6236begin(FT6236_address);
|
||||||
FT6236_found=1;
|
FT6236_found=1;
|
||||||
|
I2cSetActiveFound(FT6236_address, "FT6236");
|
||||||
} else {
|
} else {
|
||||||
FT6236_found=0;
|
FT6236_found=0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,6 +101,7 @@ void RA8876_InitDriver()
|
||||||
if (I2cEnabled(XI2C_39) && I2cSetDevice(FT5316_address)) {
|
if (I2cEnabled(XI2C_39) && I2cSetDevice(FT5316_address)) {
|
||||||
FT6236begin(FT5316_address);
|
FT6236begin(FT5316_address);
|
||||||
FT5316_found=1;
|
FT5316_found=1;
|
||||||
|
I2cSetActiveFound(FT5316_address, "FT5316");
|
||||||
} else {
|
} else {
|
||||||
FT5316_found=0;
|
FT5316_found=0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue