mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-08-01 09:54:28 +02:00
Validate raw pm before correction
This commit is contained in:
@@ -314,11 +314,10 @@ void OledDisplay::showDashboard(const char *status) {
|
|||||||
|
|
||||||
/** Draw PM2.5 value */
|
/** Draw PM2.5 value */
|
||||||
int pm25 = value.get(Measurements::PM25);
|
int pm25 = value.get(Measurements::PM25);
|
||||||
if (config.hasSensorSHT && config.isPMCorrectionEnabled()) {
|
|
||||||
pm25 = (int)value.getCorrectedPM25(*ag, config);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (utils::isValidPm(pm25)) {
|
if (utils::isValidPm(pm25)) {
|
||||||
|
if (config.hasSensorSHT && config.isPMCorrectionEnabled()) {
|
||||||
|
pm25 = (int)value.getCorrectedPM25(*ag, config);
|
||||||
|
}
|
||||||
if (config.isPmStandardInUSAQI()) {
|
if (config.isPmStandardInUSAQI()) {
|
||||||
sprintf(strBuf, "%d", ag->pms5003.convertPm25ToUsAqi(pm25));
|
sprintf(strBuf, "%d", ag->pms5003.convertPm25ToUsAqi(pm25));
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user