Tue, 29 Jul 2014 21:12:43 +0200
Code fixes and cleanup
dht11/dht11.c | file | annotate | diff | comparison | revisions | |
dht11/dht11.h | file | annotate | diff | comparison | revisions |
--- a/dht11/dht11.c Tue Jul 29 21:05:40 2014 +0200 +++ b/dht11/dht11.c Tue Jul 29 21:12:43 2014 +0200 @@ -20,16 +20,25 @@ * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *****************************************************************************/ +#include "../config.h" +#include <stdio.h> +#include <stdlib.h> +#include <stdint.h> +#include <stdarg.h> +#include <syslog.h> +#include <unistd.h> + #include "dht11.h" #ifdef HAVE_WIRINGPI_H +#include <wiringPi.h> #define MAXTIMINGS 100 int dht11_pin = -1; int dht11_temperature = -1; int dht11_humidity = -1; -int dht11_valid = false; +int dht11_valid = FALSE; int dht11_t_offset = 0; int dht11_h_offset = 0; @@ -122,7 +131,7 @@ } dht11_temperature = -1; dht11_humidity = -1; - dht11_valid = false; + dht11_valid = FALSE; return; } @@ -143,7 +152,7 @@ dht11_temperature = t; dht11_humidity = h; - dht11_valid = true; + dht11_valid = TRUE; } else { tries--; if (tries == 0)