Skip to content

Commit 7152d6d

Browse files
committedMay 31, 2014
Merge pull request adafruit#80 from larsks/master
prevent segfault caused by bitidx++
2 parents 99a2955 + 7d2ef0a commit 7152d6d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎Adafruit_DHT_Driver/Adafruit_DHT.c

+2
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ int readDHT(int type, int pin) {
105105
}
106106
laststate = bcm2835_gpio_lev(pin);
107107
if (counter == 1000) break;
108+
#ifdef DEBUG
108109
bits[bitidx++] = counter;
110+
#endif
109111

110112
if ((i>3) && (i%2 == 0)) {
111113
// shove each bit into the storage bytes

0 commit comments

Comments
 (0)
Please sign in to comment.