mirror of
https://github.com/arendst/Tasmota.git
synced 2025-04-29 09:17: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)
|
bool HP303B_Read(float &temperature, float &pressure, uint8_t hp303b_address)
|
||||||
{
|
{
|
||||||
HP303BSensor.begin(hp303b_address);
|
|
||||||
|
|
||||||
float t;
|
float t;
|
||||||
float p;
|
float p;
|
||||||
int16_t ret;
|
int16_t ret;
|
||||||
@ -80,6 +78,8 @@ void HP303B_Detect(void)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HP303BSensor.begin(addresses[i]);
|
||||||
|
|
||||||
float t;
|
float t;
|
||||||
float p;
|
float p;
|
||||||
if (HP303B_Read(t, p, addresses[i]))
|
if (HP303B_Read(t, p, addresses[i]))
|
||||||
@ -87,6 +87,7 @@ void HP303B_Detect(void)
|
|||||||
I2cSetActiveFound(addresses[i], types);
|
I2cSetActiveFound(addresses[i], types);
|
||||||
address = addresses[i];
|
address = addresses[i];
|
||||||
type = 1;
|
type = 1;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user