Skip to content

Commit ce3190f

Browse files
committed
Switch back to integer division in array indexing.
1 parent 5bc0a5c commit ce3190f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

DHT.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,11 @@ boolean DHT::read(bool force) {
194194
_lastresult = false;
195195
return _lastresult;
196196
}
197-
data[i * 0.125] <<= 1;
197+
data[i/8] <<= 1;
198198
// Now compare the low and high cycle times to see if the bit is a 0 or 1.
199199
if (highCycles > lowCycles) {
200200
// High cycles are greater than 50us low cycle count, must be a 1.
201-
data[i * 0.125] |= 1;
201+
data[i/8] |= 1;
202202
}
203203
// Else high cycles are less than (or equal to, a weird case) the 50us low
204204
// cycle count so this must be a zero. Nothing needs to be changed in the

0 commit comments

Comments
 (0)