1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-04 04:12:23 +01:00

Fix error reporting for DHT bit read loop (#2344)

This commit is contained in:
besteru
2021-09-20 10:14:44 +03:00
committed by GitHub
parent 5f21b925da
commit 82eca13d7b

View File

@@ -122,6 +122,8 @@ bool HOT ICACHE_RAM_ATTR DHT::read_sensor_(float *temperature, float *humidity,
break;
}
}
if (error_code != 0)
break;
start_time = micros();
uint32_t end_time = start_time;
@@ -136,6 +138,8 @@ bool HOT ICACHE_RAM_ATTR DHT::read_sensor_(float *temperature, float *humidity,
break;
}
}
if (error_code != 0)
break;
if (i < 0)
continue;