From b958c6e1f61e6131f3915466201f02a812a0f834 Mon Sep 17 00:00:00 2001 From: niesteszeck Date: Thu, 4 Jul 2013 10:14:49 -0400 Subject: [PATCH] v 0.1.1 Optimization by pylon added a changelog --- README.md | 25 ++++++++++++++++++------- idDHT11.cpp | 11 +++++++++-- idDHT11.h | 18 ++++++++++++------ 3 files changed, 39 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 10e831c..9da8d1f 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,22 @@ idDHT11 Interrupt driven DHT11 library -VERSION: 0.1 -PURPOSE: Interrupt driven Lib for DHT11 with Arduino. - -LICENCE: GPL v3 (http://www.gnu.org/licenses/gpl.html) - -DATASHEET: http://www.micro4you.com/files/sensor/DHT11.pdf + VERSION: 0.1.1 -Based on DHT11 library: http://playground.arduino.cc/Main/DHT11Lib + PURPOSE: Interrupt driven Lib for DHT11 with Arduino. + + LICENCE: GPL v3 (http://www.gnu.org/licenses/gpl.html) + + DATASHEET: http://www.micro4you.com/files/sensor/DHT11.pdf + + Based on DHT11 library: http://playground.arduino.cc/Main/DHT11Lib + + Changelog: + + v 0.1 + + First version, added Functionality to DHT11 sensor + + v 0.1.1 + + Optimizacion on shift var (pylon from Arduino Forum) diff --git a/idDHT11.cpp b/idDHT11.cpp index b67ed01..f51e077 100644 --- a/idDHT11.cpp +++ b/idDHT11.cpp @@ -1,11 +1,17 @@ /* FILE: idDHT11.cpp - VERSION: 0.1 + VERSION: 0.1.1 PURPOSE: Interrupt driven Lib for DHT11 with Arduino. LICENCE: GPL v3 (http://www.gnu.org/licenses/gpl.html) DATASHEET: http://www.micro4you.com/files/sensor/DHT11.pdf Based on DHT11 library: http://playground.arduino.cc/Main/DHT11Lib + + Changelog: + v 0.1 + First version, added Functionality to DHT11 sensor + v 0.1.1 + Optimizacion on shift var (pylon from Arduino Forum) */ #include "idDHT11.h" @@ -91,8 +97,9 @@ void idDHT11::isrCallback() { status = IDDHTLIB_ERROR_DELTA; state = STOPPED; } else if(6090) //is a one - bits[idx] |= (1 << cnt); + bits[idx] |= 1; if (cnt == 0) { // whe have fullfilled the byte, go to next cnt = 7; // restart at MSB if(idx++ == 4) { // go to next byte, if whe have got 5 bytes stop. diff --git a/idDHT11.h b/idDHT11.h index 384cc44..ea4ef59 100644 --- a/idDHT11.h +++ b/idDHT11.h @@ -1,11 +1,17 @@ /* FILE: idDHT11.h - VERSION: 0.1 + VERSION: 0.1.1 PURPOSE: Interrupt driven Lib for DHT11 with Arduino. LICENCE: GPL v3 (http://www.gnu.org/licenses/gpl.html) DATASHEET: http://www.micro4you.com/files/sensor/DHT11.pdf - Based on DHT11 library: http://playground.arduino.cc/Main/DHT11Lib + Based on DHT11 library: http://playground.arduino.cc/Main/DHT11Lib + + Changelog: + v 0.1 + First version, added Functionality to DHT11 sensor + v 0.1.1 + Optimizacion on shift var (pylon from Arduino Forum) */ @@ -18,7 +24,7 @@ #include #endif -#define IDDHT11LIB_VERSION "0.1" +#define IDDHT11LIB_VERSION "0.1.1" // state codes #define IDDHTLIB_OK 0 @@ -33,9 +39,9 @@ #define IDDHTLIB_ERROR_DELTA -4 #define IDDHTLIB_ERROR_NOTSTARTED -5 -#define IDDHT11_CHECK_STATE if(state == STOPPED) \ - return status; \ - else if(state != ACQUIRED) \ +#define IDDHT11_CHECK_STATE if(state == STOPPED) \ + return status; \ + else if(state != ACQUIRED) \ return IDDHTLIB_ERROR_ACQUIRING; class idDHT11