d2r2 / go-dht

Golang library to interact with DHT11/DHT22/DHT12 temperature and humidity sensors from Raspberry PI.
MIT License
133 stars 52 forks source link

fix compiler warnings #4

Closed andybrown668 closed 7 years ago

andybrown668 commented 7 years ago

Hi, thanks for the lib - works great! here's a patch to get rid of compiler warnings - I see these when cross-compiling to arm with CC=arm-linux-gnueabi-gcc CGO_ENABLED=1 GOOS=linux GOARCH=arm GOARM=6 go build

----------------------------------- dht.go.h ----------------------------------- index 6cda1e0..fc05c70 100644 @@ -7,6 +7,7 @@

include

include

include

+#include

// GPIO direction: receive either output data to specific GPIO pin.

define IN 0

@@ -52,7 +53,9 @@ static int gpio_export(int port, Pin pin) { } (pin).pin = port; bytes_written = snprintf(buffer, BUFFER_MAX, "%d", (*pin).pin);

d2r2 commented 7 years ago

Hi, @andybrown668! Thank you for pleasant words regarding this lib :) Give me few days and I will come back with extended answer. Frankly, I never try to cross comply this lib (and made all this stuff few years ago), so give me some time to reproduce this issue, with the approach you describe.

d2r2 commented 7 years ago

@andybrown668, thanks again for pointing issue in C-code! Your changes proposed merged to the library.