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) {
92
92
}
93
93
94
94
// 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);
97
98
return isFahrenheit ? hi : convertFtoC (hi);
98
99
}
99
100
100
101
// 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) {
102
104
// Using both Rothfusz and Steadman's equations
103
105
// http://www.wpc.ncep.noaa.gov/html/heatindex_equation.shtml
104
106
float hi;
@@ -243,7 +245,11 @@ bool DHT::read(bool force) {
243
245
// in the very latest IDE versions):
244
246
// https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/cores/arduino/wiring_pulse.c
245
247
uint32_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
247
253
// On AVR platforms use direct GPIO port access as it's much faster and better
248
254
// for catching pulses that are 10's of microseconds in length:
249
255
#ifdef __AVR
You can’t perform that action at this time.
0 commit comments