Skip to content
This repository was archived by the owner on Sep 30, 2019. It is now read-only.

Commit 7152d6d

Browse files
committed
Merge pull request #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)