Remove the firstreading variable

By cleverly setting _lastreadtime in begin() to make sure that it looks
like the last read was alrady 2000 ms ago, even on startup when millis()
still returns 0, there is no longer a need to keep a separate
firstreading variable, saving a byte of memory and a bit of code.
This commit is contained in:
Matthijs Kooijman
2015-07-24 21:17:16 +02:00
parent f1b79028ea
commit 5973929e63
2 changed files with 7 additions and 5 deletions

1
DHT.h
View File

@ -50,7 +50,6 @@ class DHT {
uint8_t data[6];
uint8_t _pin, _type, _bit, _port;
uint32_t _lastreadtime, _maxcycles;
bool _firstreading;
bool _lastresult;
uint32_t expectPulse(bool level);