forked from adafruit/DHT-sensor-library
ESP8266: yield() immediately before & after interrupt disablage
This commit is contained in:
7
DHT.h
7
DHT.h
@@ -67,6 +67,9 @@ class DHT {
|
||||
class InterruptLock {
|
||||
public:
|
||||
InterruptLock() {
|
||||
#if defined(ESP8266)
|
||||
yield();
|
||||
#endif
|
||||
#if !defined(ARDUINO_ARCH_NRF52)
|
||||
noInterrupts();
|
||||
#endif
|
||||
@@ -74,9 +77,11 @@ class InterruptLock {
|
||||
~InterruptLock() {
|
||||
#if !defined(ARDUINO_ARCH_NRF52)
|
||||
interrupts();
|
||||
#endif
|
||||
#if defined(ESP8266)
|
||||
yield();
|
||||
#endif
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user