Correct negative results in DHT driver (#3210)
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 <3829486b93ec44395f0b980424bae9b6fb07b7bc@dondero.eu>
nodemcu/nodemcu-firmware,HEYAHONG/nodemcu-firmware,nodemcu/nodemcu-firmware,nwf/nodemcu-firmware,nodemcu/nodemcu-firmware,nwf/nodemcu-firmware,HEYAHONG/nodemcu-firmware,FelixPe/nodemcu-firmware,FelixPe/nodemcu-firmware,eku/nodemcu-firmware,eku/nodemcu-firmware,marcelstoer/nodemcu-firmware,nwf/nodemcu-firmware,eku/nodemcu-firmware,FelixPe/nodemcu-firmware,marcelstoer/nodemcu-firmware,marcelstoer/nodemcu-firmware,FelixPe/nodemcu-firmware,vsky279/nodemcu-firmware,marcelstoer/nodemcu-firmware,marcelstoer/nodemcu-firmware,vsky279/nodemcu-firmware,vsky279/nodemcu-firmware,HEYAHONG/nodemcu-firmware,FelixPe/nodemcu-firmware,eku/nodemcu-firmware,nodemcu/nodemcu-firmware,nodemcu/nodemcu-firmware,HEYAHONG/nodemcu-firmware,nwf/nodemcu-firmware,nwf/nodemcu-firmware,vsky279/nodemcu-firmware,vsky279/nodemcu-firmware,HEYAHONG/nodemcu-firmware