mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-22 18:26:30 +00:00
fix: detection of SPS30 serial number (#17809)
This commit is contained in:
parent
400f0e453e
commit
91559ec883
@ -140,14 +140,16 @@ unsigned char cmdb[6];
|
||||
void SPS30_Detect(void)
|
||||
{
|
||||
if (!I2cSetDevice(SPS30_ADDR)) { return; }
|
||||
I2cSetActiveFound(SPS30_ADDR, "SPS30");
|
||||
|
||||
uint8_t dcode[32];
|
||||
sps30_get_data(SPS_CMD_GET_SERIAL,dcode,sizeof(dcode));
|
||||
if(dcode[0] == 0) {
|
||||
return;
|
||||
}
|
||||
AddLog(LOG_LEVEL_DEBUG, PSTR("sps30 found with serial: %s"), dcode);
|
||||
sps30_cmd(SPS_CMD_START_MEASUREMENT);
|
||||
sps30_running = 1;
|
||||
sps30_ready = 1;
|
||||
I2cSetActiveFound(SPS30_ADDR, "SPS30");
|
||||
}
|
||||
|
||||
#define D_UNIT_PM "ug/m3"
|
||||
|
Loading…
x
Reference in New Issue
Block a user