Skip to content

Commit

Permalink
ESP8266: yield() immediately before & after interrupt disablage
Browse files Browse the repository at this point in the history
  • Loading branch information
PaintYourDragon committed Feb 14, 2019
1 parent 7cec0cb commit 9bf1255
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion DHT.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,21 @@ class DHT {
class InterruptLock {
public:
InterruptLock() {
#if defined(ESP8266)
yield();
#endif
#if !defined(ARDUINO_ARCH_NRF52)
noInterrupts();
#endif
}
~InterruptLock() {
#if !defined(ARDUINO_ARCH_NRF52)
interrupts();
#endif
#if defined(ESP8266)
yield();
#endif
}

};

#endif

0 comments on commit 9bf1255

Please sign in to comment.