From 9611395a77bf8600362319f2f742438ebd5d9cdf Mon Sep 17 00:00:00 2001 From: Tony DiCola Date: Mon, 2 Jun 2014 13:13:50 -0700 Subject: [PATCH] Switch to use noInterrupts and interrupts function. make read() public. This resolves pull #15. --- DHT.cpp | 4 ++-- DHT.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DHT.cpp b/DHT.cpp index 0033ac8..a07eeda 100644 --- a/DHT.cpp +++ b/DHT.cpp @@ -119,7 +119,7 @@ boolean DHT::read(void) { pinMode(_pin, OUTPUT); digitalWrite(_pin, LOW); delay(20); - cli(); + noInterrupts(); digitalWrite(_pin, HIGH); delayMicroseconds(40); pinMode(_pin, INPUT); @@ -149,7 +149,7 @@ boolean DHT::read(void) { } - sei(); + interrupts(); /* Serial.println(j, DEC); diff --git a/DHT.h b/DHT.h index 3455c06..8f40a02 100644 --- a/DHT.h +++ b/DHT.h @@ -24,7 +24,6 @@ class DHT { private: uint8_t data[6]; uint8_t _pin, _type, _count; - boolean read(void); unsigned long _lastreadtime; boolean firstreading; @@ -35,6 +34,7 @@ class DHT { float convertCtoF(float); float computeHeatIndex(float tempFahrenheit, float percentHumidity); float readHumidity(void); + boolean read(void); }; #endif