Skip to content

Commit f566d58

Browse files
Move ESP8266 yield() out of InterruptLock
1 parent 9bf1255 commit f566d58

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

DHT.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ bool DHT::read(bool force) {
155155
// Reset 40 bits of received data to zero.
156156
data[0] = data[1] = data[2] = data[3] = data[4] = 0;
157157

158+
#if defined(ESP8266)
159+
yield(); // Handle WiFi / reset software watchdog
160+
#endif
161+
158162
// Send start signal. See DHT datasheet for full signal diagram:
159163
// http://www.adafruit.com/datasheets/Digital%20humidity%20and%20temperature%20sensor%20AM2302.pdf
160164

DHT.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,13 @@ class DHT {
6767
class InterruptLock {
6868
public:
6969
InterruptLock() {
70-
#if defined(ESP8266)
71-
yield();
72-
#endif
7370
#if !defined(ARDUINO_ARCH_NRF52)
7471
noInterrupts();
7572
#endif
7673
}
7774
~InterruptLock() {
7875
#if !defined(ARDUINO_ARCH_NRF52)
7976
interrupts();
80-
#endif
81-
#if defined(ESP8266)
82-
yield();
8377
#endif
8478
}
8579
};

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=DHT sensor library
2-
version=1.3.3
2+
version=1.3.4
33
author=Adafruit
44
maintainer=Adafruit <[email protected]>
55
sentence=Arduino library for DHT11, DHT22, etc Temp & Humidity Sensors

0 commit comments

Comments
 (0)