From e2769e3a7e279440134188fdfe19052ccdb7383e Mon Sep 17 00:00:00 2001 From: Alex Gutowski Date: Mon, 28 Oct 2013 00:54:06 -0500 Subject: [PATCH] Updates idDHT11.cpp to differentiate between timeouts Creates three different error codes instead of a single code for three timeout possibilities. --- idDHT11.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/idDHT11.cpp b/idDHT11.cpp index b67ed01..4f03667 100644 --- a/idDHT11.cpp +++ b/idDHT11.cpp @@ -67,7 +67,7 @@ void idDHT11::isrCallback() { int delta = (newUs-us); us = newUs; if (delta>6000) { - status = IDDHTLIB_ERROR_TIMEOUT; + status = IDDHTLIB_ERROR_ISR_TIMEOUT; state = STOPPED; detachInterrupt(intNumber); return; @@ -81,7 +81,7 @@ void idDHT11::isrCallback() { state = DATA; } else { detachInterrupt(intNumber); - status = IDDHTLIB_ERROR_TIMEOUT; + status = IDDHTLIB_ERROR_RESPONSE_TIMEOUT; state = STOPPED; } break; @@ -114,7 +114,7 @@ void idDHT11::isrCallback() { } else cnt--; } else { detachInterrupt(intNumber); - status = IDDHTLIB_ERROR_TIMEOUT; + status = IDDHTLIB_ERROR_DATA_TIMEOUT; state = STOPPED; } break; @@ -176,4 +176,4 @@ double idDHT11::getDewPointSlow() { double T = log(VP/0.61078); // temp var return (241.88 * T) / (17.558-T); } -// EOF \ No newline at end of file +// EOF