commit | b94edd239373be73b9cb37c84930560e87a0b122 | [log] [tgz] |
---|---|---|
author | Aurelien Jarno <aurelien@aurel32.net> | Thu Jun 24 22:52:04 2021 +0200 |
committer | Anas Nashif <anas.nashif@intel.com> | Mon Jun 28 11:53:56 2021 -0400 |
tree | 980104aca379982cd9a8a8a360d03bd0412c86e1 | |
parent | ebf35f8f938b3be43821dae798d580c6dd24c714 [diff] |
drivers/sensor: ms5607: fix compensation for temperature < 20C When the temperature is lower than 20C, adc_temperature is smaller than (data->t_ref << 8), which should yield a negative value for dT. While dT and adc_temperature are correctly declared as signed, the subtrahend is wrongly casted to unsigned, yielding insanely high temperature values. Fix that by casting it to int32_t instead of uint32_t. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>