-

Fork of HygroClip2 by Jan Wolfsberger

Files at this revision

API Documentation at this revision

Comitter:
wolfsberger
Date:
Mon May 02 14:09:30 2016 +0000
Parent:
1:810b9b0dd9a4
Commit message:
-

Changed in this revision

HygroClip2.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 810b9b0dd9a4 -r b41e36e81711 HygroClip2.cpp
--- a/HygroClip2.cpp	Tue Mar 15 07:45:31 2016 +0000
+++ b/HygroClip2.cpp	Mon May 02 14:09:30 2016 +0000
@@ -12,8 +12,8 @@
 void HygroClip2::uartCallback()
 {
     static size_t index = 0;
-    uint8_t data = uart_.getc();
-
+    uint8_t data = LPC_UART3->RBR;
+    
     if (dataReadyToPars_) {
         return;
     }
@@ -47,7 +47,6 @@
         temperature_ = NAN;
         isDataValid_ = false;
     }
-
     uart_.printf("{F00RDD}\r");
 }
 
@@ -72,5 +71,9 @@
 }
 bool HygroClip2::isDataValid()
 {
+    if (humidity_ == NAN || humidity_ == 0.0f)
+        return false;
+    if (temperature_ == NAN || temperature_ == 0.0f)
+        return false;
     return isDataValid_;
 }