mirror of https://github.com/arendst/Tasmota.git
check id reg
This commit is contained in:
parent
a1ef7b254e
commit
58c7fac140
|
@ -64,11 +64,14 @@ bool Tsl2561Read(void)
|
||||||
void Tsl2561Detect(void)
|
void Tsl2561Detect(void)
|
||||||
{
|
{
|
||||||
if (tsl2561_type) { return; }
|
if (tsl2561_type) { return; }
|
||||||
|
uint8_t id;
|
||||||
|
|
||||||
if ((I2cDevice(0x29) || I2cDevice(0x39) || I2cDevice(0x49))&&Tsl.begin()) {
|
if (I2cDevice(0x29) || I2cDevice(0x39) || I2cDevice(0x49)) {
|
||||||
|
if (!Tsl.id(&id)) return;
|
||||||
|
Tsl.begin();
|
||||||
if (Tsl.on()) {
|
if (Tsl.on()) {
|
||||||
tsl2561_type = 1;
|
tsl2561_type = 1;
|
||||||
snprintf_P(log_data, sizeof(log_data), S_LOG_I2C_FOUND_AT, tsl2561_types, Tsl.address());
|
snprintf_P(log_data, sizeof(log_data), S_LOG_I2C_FOUND_AT, tsl2561_types, Tsl.address(), id);
|
||||||
AddLog(LOG_LEVEL_DEBUG);
|
AddLog(LOG_LEVEL_DEBUG);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue