File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -92,13 +92,15 @@ float DHT::readHumidity(bool force) {
9292}
9393
9494// boolean isFahrenheit: True == Fahrenheit; False == Celcius
95- float DHT::computeHeatIndex (isFahrenheit) {
96- float hi = self.computeHeatIndex (self.readTemperature (isFahrenheit), self.readHumidity (), isFahrenheit);
95+ float DHT::computeHeatIndex (bool isFahrenheit) {
96+ float hi = computeHeatIndex (readTemperature (isFahrenheit), readHumidity (),
97+ isFahrenheit);
9798 return isFahrenheit ? hi : convertFtoC (hi);
9899}
99100
100101// boolean isFahrenheit: True == Fahrenheit; False == Celcius
101- float DHT::computeHeatIndex (float temperature, floast percentHumidity, bool isFahrenheit) {
102+ float DHT::computeHeatIndex (float temperature, float percentHumidity,
103+ bool isFahrenheit) {
102104 // Using both Rothfusz and Steadman's equations
103105 // http://www.wpc.ncep.noaa.gov/html/heatindex_equation.shtml
104106 float hi;
@@ -243,7 +245,11 @@ bool DHT::read(bool force) {
243245// in the very latest IDE versions):
244246// https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/cores/arduino/wiring_pulse.c
245247uint32_t DHT::expectPulse (bool level) {
246- uint16_t count = 0 ;
248+ #if (F_CPU > 16000000L)
249+ uint32_t count = 0 ;
250+ #else
251+ uint16_t count = 0 ; // To work fast enough on slower AVR boards
252+ #endif
247253 // On AVR platforms use direct GPIO port access as it's much faster and better
248254 // for catching pulses that are 10's of microseconds in length:
249255 #ifdef __AVR
You can’t perform that action at this time.
0 commit comments