nodemcu-firmware/app/dht
Emdioh bf15299cea
Correct negative results in DHT driver (#3210)
* DHT module: fix the handling of negative temps.

The macro handling the conversion from the 2 bytes buffer to a double
was handling negative values by checking the sign bit and taking the
negative value of the number minus the sign bit.
Unfortunately this does not work as the negative values are represented
in 1's complement, so for instance -1 was becoming -32767
  * +1 = b0000_0000_0000_ 0001
  * -1 = 1111_1111_1111_1111

This replace the spacial code with a signed 16 bits value.

* Refactoring: removes some code duplication.

* Fixed the conversion of the 8/16 bits values

Co-authored-by: Marco Dondero <marco@dondero.eu>
2020-08-03 19:58:19 +01:00
..
Makefile Dev make cleanup (#2842) 2019-07-23 18:47:18 +03:00
dht.c Correct negative results in DHT driver (#3210) 2020-08-03 19:58:19 +01:00
dht.h Evict c_types.h, tidy up a other c_prefixes. (#2841) 2019-07-23 14:22:38 +10:00