Skip to content

Commit

Permalink
sns(dht): dont overwrite dht22 sign bit
Browse files Browse the repository at this point in the history
  • Loading branch information
mcspr committed Mar 5, 2025
1 parent abbf721 commit 7476793
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions code/espurna/sensors/DHTSensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ float dht_temperature(DHTChipType type, std::array<uint8_t, 2> pair) {
out = tmp;
// fallback works both for the original chips and positive numbers
} else {
pair[0] &= MagnitudeMask;
out = (pair[0] << 8) | pair[1];
out = ((pair[0] & MagnitudeMask) << 8) | pair[1];
if (pair[0] & SignMask) {
out = -out;
}
Expand Down

0 comments on commit 7476793

Please sign in to comment.