mirror of
https://github.com/adafruit/DHT-sensor-library.git
synced 2023-10-23 22:20:38 +03:00
Move ESP8266 yield() out of InterruptLock
This commit is contained in:
parent
9bf12551d8
commit
f566d58f47
4
DHT.cpp
4
DHT.cpp
@ -155,6 +155,10 @@ bool DHT::read(bool force) {
|
|||||||
// Reset 40 bits of received data to zero.
|
// Reset 40 bits of received data to zero.
|
||||||
data[0] = data[1] = data[2] = data[3] = data[4] = 0;
|
data[0] = data[1] = data[2] = data[3] = data[4] = 0;
|
||||||
|
|
||||||
|
#if defined(ESP8266)
|
||||||
|
yield(); // Handle WiFi / reset software watchdog
|
||||||
|
#endif
|
||||||
|
|
||||||
// Send start signal. See DHT datasheet for full signal diagram:
|
// Send start signal. See DHT datasheet for full signal diagram:
|
||||||
// http://www.adafruit.com/datasheets/Digital%20humidity%20and%20temperature%20sensor%20AM2302.pdf
|
// http://www.adafruit.com/datasheets/Digital%20humidity%20and%20temperature%20sensor%20AM2302.pdf
|
||||||
|
|
||||||
|
6
DHT.h
6
DHT.h
@ -67,9 +67,6 @@ class DHT {
|
|||||||
class InterruptLock {
|
class InterruptLock {
|
||||||
public:
|
public:
|
||||||
InterruptLock() {
|
InterruptLock() {
|
||||||
#if defined(ESP8266)
|
|
||||||
yield();
|
|
||||||
#endif
|
|
||||||
#if !defined(ARDUINO_ARCH_NRF52)
|
#if !defined(ARDUINO_ARCH_NRF52)
|
||||||
noInterrupts();
|
noInterrupts();
|
||||||
#endif
|
#endif
|
||||||
@ -77,9 +74,6 @@ class InterruptLock {
|
|||||||
~InterruptLock() {
|
~InterruptLock() {
|
||||||
#if !defined(ARDUINO_ARCH_NRF52)
|
#if !defined(ARDUINO_ARCH_NRF52)
|
||||||
interrupts();
|
interrupts();
|
||||||
#endif
|
|
||||||
#if defined(ESP8266)
|
|
||||||
yield();
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
name=DHT sensor library
|
name=DHT sensor library
|
||||||
version=1.3.3
|
version=1.3.4
|
||||||
author=Adafruit
|
author=Adafruit
|
||||||
maintainer=Adafruit <info@adafruit.com>
|
maintainer=Adafruit <info@adafruit.com>
|
||||||
sentence=Arduino library for DHT11, DHT22, etc Temp & Humidity Sensors
|
sentence=Arduino library for DHT11, DHT22, etc Temp & Humidity Sensors
|
||||||
|
Loading…
Reference in New Issue
Block a user