mirror of https://github.com/arendst/Tasmota.git
parent
7581439133
commit
4b884679e6
tasmota
|
@ -46,10 +46,9 @@ struct HIH6 {
|
|||
bool Hih6Read(void)
|
||||
{
|
||||
Wire.beginTransmission(HIH6_ADDR);
|
||||
// Wire.write(0x00); // Select data register
|
||||
if (Wire.endTransmission() != 0) { return false; } // In case of error
|
||||
|
||||
// delay(40); // Wait for Valid data or use Stale data
|
||||
delay(40); // Wait for Valid data (Stale data doesn't work. See #6808)
|
||||
|
||||
uint8_t data[4];
|
||||
Wire.requestFrom(HIH6_ADDR, 4);
|
||||
|
@ -76,10 +75,12 @@ bool Hih6Read(void)
|
|||
void Hih6Detect(void)
|
||||
{
|
||||
if (Hih6.type) { return; }
|
||||
if (I2cActive(HIH6_ADDR)) { return; }
|
||||
|
||||
if (uptime < 2) { delay(20); } // Skip entering power on comand mode
|
||||
Hih6.type = Hih6Read();
|
||||
if (Hih6.type) {
|
||||
I2cSetActive(HIH6_ADDR);
|
||||
AddLog_P2(LOG_LEVEL_DEBUG, S_LOG_I2C_FOUND_AT, Hih6.types, HIH6_ADDR);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue