From 4c34cc2a57c0fc525d4e1341538fb00a4b96d17e Mon Sep 17 00:00:00 2001 From: p-a-c-o Date: Sun, 26 Jan 2014 14:57:08 +0100 Subject: [PATCH] Propagate changed return value of readDHT -Invert return value of readDHT (0=success) -Return result of readDHT to executing process --- Adafruit_DHT_Driver/Adafruit_DHT.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Adafruit_DHT_Driver/Adafruit_DHT.c b/Adafruit_DHT_Driver/Adafruit_DHT.c index 9d1746be..4b63f534 100644 --- a/Adafruit_DHT_Driver/Adafruit_DHT.c +++ b/Adafruit_DHT_Driver/Adafruit_DHT.c @@ -63,8 +63,7 @@ int main(int argc, char **argv) printf("Using pin #%d\n", dhtpin); - readDHT(type, dhtpin); - return 0; + return readDHT(type, dhtpin); } // main @@ -141,8 +140,8 @@ int readDHT(int type, int pin) { if (data[2] & 0x80) f *= -1; printf("Temp = %.1f *C, Hum = %.1f \%\n", f, h); } - return 1; + return 0; } - return 0; + return 1; }