You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2018/12/12 13:09:42 UTC

[mynewt-core] 04/06: hw/drivers/bme280: Fix integer calculation compilation

This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 7e05db326a8a0dbe165884d7aea58c115a855384
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Fri Dec 7 09:47:37 2018 +0100

    hw/drivers/bme280: Fix integer calculation compilation
    
    Integer calculation build variant was outdated and would not build.
    This aligns code for double and integer computations.
---
 hw/drivers/sensors/bme280/src/bme280.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/hw/drivers/sensors/bme280/src/bme280.c b/hw/drivers/sensors/bme280/src/bme280.c
index 1e8eda2..0570c3e 100644
--- a/hw/drivers/sensors/bme280/src/bme280.c
+++ b/hw/drivers/sensors/bme280/src/bme280.c
@@ -409,7 +409,7 @@ bme280_compensate_pressure(struct sensor_itf *itf, int32_t rawpress,
  */
 static float
 bme280_compensate_humidity(struct sensor_itf *itf, uint32_t rawhumid,
-                           struct bme280_calib_data *bcd)
+                           struct bme280_pdd *pdd)
 {
     int32_t h;
     int32_t temp;
@@ -421,13 +421,13 @@ bme280_compensate_humidity(struct sensor_itf *itf, uint32_t rawhumid,
         return NAN;
     }
 
-    if (!g_t_fine) {
-        if(!bme280_get_temperature(&temp)) {
-            (void)bme280_compensate_temperature(temp, bcd);
+    if (!pdd->t_fine) {
+        if(!bme280_get_temperature(itf, &temp)) {
+            (void)bme280_compensate_temperature(temp, pdd);
         }
     }
 
-    tmp32 = (g_t_fine - ((int32_t)76800));
+    tmp32 = (pdd->t_fine - ((int32_t)76800));
 
     tmp32 = (((((rawhumid << 14) - (((int32_t)pdd->bcd.bcd_dig_H4) << 20) -
              (((int32_t)pdd->bcd.bcd_dig_H5) * tmp32)) + ((int32_t)16384)) >> 15) *