Add re-probe to NovaSDS sensor

Add re-probe to NovaSDS sensor (#4335)
This commit is contained in:
Theo Arends 2018-11-13 15:15:11 +01:00
parent a0aff442dd
commit a01f9bdda1

View File

@ -73,8 +73,6 @@ void NovaSdsSetWorkPeriod()
} }
} }
bool NovaSdsReadData() bool NovaSdsReadData()
{ {
if (! NovaSdsSerial->available()) return false; if (! NovaSdsSerial->available()) return false;
@ -101,8 +99,6 @@ bool NovaSdsReadData()
return false; return false;
} }
novasds_valid = 10;
return true; return true;
} }
@ -110,6 +106,11 @@ bool NovaSdsReadData()
void NovaSdsSecond() // Every second void NovaSdsSecond() // Every second
{ {
if (XSNS_20 == (uptime % 100)) {
if (!novasds_valid) {
NovaSdsSetWorkPeriod();
}
} else {
if (NovaSdsReadData()) { if (NovaSdsReadData()) {
novasds_valid = 10; novasds_valid = 10;
} else { } else {
@ -117,6 +118,7 @@ void NovaSdsSecond() // Every second
novasds_valid--; novasds_valid--;
} }
} }
}
} }
/*********************************************************************************************/ /*********************************************************************************************/