From 190772edc59464260721d2cdcfa79d94e9d388a2 Mon Sep 17 00:00:00 2001 From: Karim Keddam Date: Mon, 30 Nov 2015 03:50:58 -0500 Subject: [PATCH] Fixed error with temperature computation --- drivers/sensors/ms58xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/sensors/ms58xx.c b/drivers/sensors/ms58xx.c index 1a4352acdf..d7872b5c5e 100644 --- a/drivers/sensors/ms58xx.c +++ b/drivers/sensors/ms58xx.c @@ -589,7 +589,7 @@ static int ms58xx_measure(FAR struct ms58xx_dev_s *priv) return ret; } - diff = (int32_t)rawtemp - (int32_t)priv->c5 / ((int32_t)1 << 8); + diff = (int32_t)rawtemp - (int32_t)priv->c5 * ((int32_t)1 << 8); temp = (int32_t)((int64_t)2000 + (int64_t)diff * (int64_t)priv->c6 / ((int64_t)1 << 23));