mirror of
https://github.com/adafruit/DHT-sensor-library.git
synced 2023-10-23 22:20:38 +03:00
ESP8266: yield() immediately before & after interrupt disablage
This commit is contained in:
parent
7cec0cb06d
commit
9bf12551d8
7
DHT.h
7
DHT.h
@ -67,6 +67,9 @@ 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
|
||||||
@ -74,9 +77,11 @@ class InterruptLock {
|
|||||||
~InterruptLock() {
|
~InterruptLock() {
|
||||||
#if !defined(ARDUINO_ARCH_NRF52)
|
#if !defined(ARDUINO_ARCH_NRF52)
|
||||||
interrupts();
|
interrupts();
|
||||||
|
#endif
|
||||||
|
#if defined(ESP8266)
|
||||||
|
yield();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user