-
Fork of HygroClip2 by
Diff: HygroClip2.cpp
- Revision:
- 2:b41e36e81711
- Parent:
- 1:810b9b0dd9a4
--- 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_; }