From fd2b6c81c9fba73e6123f099ee01b01278ab8d0b Mon Sep 17 00:00:00 2001 From: Filip Matusiak Date: Tue, 10 Jan 2017 23:41:29 +0100 Subject: [PATCH] dht22: fix a typo in the temperature mask again This is similar to commit a1f370c83bbe8a65cf9e13865bbea08ccf51e1f6 "dht22: fix a typo in the mask not to loose a bit in temperature" Let's do the same in get_temperature in case one uses this API. --- lib/Dht/Dht.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Dht/Dht.cpp b/lib/Dht/Dht.cpp index 3514a92..e06d1f5 100644 --- a/lib/Dht/Dht.cpp +++ b/lib/Dht/Dht.cpp @@ -26,7 +26,7 @@ int16_t Dht::get_temperature(void) return INT16_MIN; } - t = _data[3] + ((_data[2] & 0x7E)<<8); + t = _data[3] + ((_data[2] & 0x7F)<<8); return (_data[2] & 0x80) ? -t : t; }