mirror of
https://github.com/arendst/Tasmota.git
synced 2025-04-28 00:37:16 +00:00
Mover begin() to detect function
This commit is contained in:
parent
caa539e236
commit
aa5587f9e1
@ -49,8 +49,6 @@ char types[7] = "HP303B";
|
||||
|
||||
bool HP303B_Read(float &temperature, float &pressure, uint8_t hp303b_address)
|
||||
{
|
||||
HP303BSensor.begin(hp303b_address);
|
||||
|
||||
float t;
|
||||
float p;
|
||||
int16_t ret;
|
||||
@ -80,6 +78,8 @@ void HP303B_Detect(void)
|
||||
continue;
|
||||
}
|
||||
|
||||
HP303BSensor.begin(addresses[i]);
|
||||
|
||||
float t;
|
||||
float p;
|
||||
if (HP303B_Read(t, p, addresses[i]))
|
||||
@ -87,6 +87,7 @@ void HP303B_Detect(void)
|
||||
I2cSetActiveFound(addresses[i], types);
|
||||
address = addresses[i];
|
||||
type = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user