Fixed valid data checks and prevented to copy nan data to webUpdater.

This commit is contained in:
Kai Lauterbach 2022-09-14 12:42:01 +02:00
parent 76475b7c33
commit c89486bd31
2 changed files with 7 additions and 3 deletions

View File

@ -450,7 +450,7 @@ void _fsm_loop()
#ifdef INFLUXDB_FEATURE
for (uint8_t i = 0; i < 5 and validData == false; i++)
{
if (currentSensorData[i] != 0)
if (currentSensorData[i] != 0 and currentSensorData[i] != nanf("no value") and (not isnan(currentSensorData[i])))
{
validData = true;
}

View File

@ -80,7 +80,7 @@ void setSensorData(float sensorValues[])
for (uint8_t i = 0; i < 5 and wuValidData == false; i++)
{
if (sensorValues[i] != 0)
if (sensorValues[i] != 0 and sensorValues[i] != nanf("no value") and (not isnan(sensorValues[i])))
{
wuValidData = true; // at least one value is not zero, the data
}
@ -88,9 +88,13 @@ void setSensorData(float sensorValues[])
for (uint8_t i = 0; i < VALUES; i++)
{
if (sensorValues[i] != nanf("no value") and (not isnan(sensorValues[i])))
{
// only copy real float values
_webUpdater_sensValues[i] = sensorValues[i];
}
}
}
//*************************************************************************//