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/07 20:11:54 UTC

[mynewt-core] branch master updated: hw/drivers/bme280: Fix build errors

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


The following commit(s) were added to refs/heads/master by this push:
     new b1e1a42  hw/drivers/bme280: Fix build errors
b1e1a42 is described below

commit b1e1a42694f7353c0cecaca42af344307bc583e3
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Thu Dec 6 16:10:42 2018 +0100

    hw/drivers/bme280: Fix build errors
    
    Code was using undefined macro to access field.
---
 hw/drivers/sensors/bme280/src/bme280.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/hw/drivers/sensors/bme280/src/bme280.c b/hw/drivers/sensors/bme280/src/bme280.c
index 1226e90..689368c 100644
--- a/hw/drivers/sensors/bme280/src/bme280.c
+++ b/hw/drivers/sensors/bme280/src/bme280.c
@@ -833,15 +833,13 @@ bme280_readlen(struct sensor_itf *itf, uint8_t addr, uint8_t *payload,
     int rc;
 
 #if MYNEWT_VAL(BUS_DRIVER_PRESENT)
-    struct os_dev *dev = SENSOR_ITF_GET_DEVICE(itf);
-
     /* XXX this is only required for SPI, but apparently device has no problem
      * with this being set also for I2C so let's leave it for now since there's
      * no API now to figure out bus type for node
      */
     addr |= BME280_SPI_READ_CMD_BIT;
 
-    rc = bus_node_simple_write_read_transact(dev, &addr, 1, payload, len);
+    rc = bus_node_simple_write_read_transact(itf->si_dev, &addr, 1, payload, len);
 #else
     int i;
     uint16_t retval;
@@ -900,7 +898,7 @@ bme280_writelen(struct sensor_itf *itf, uint8_t addr, uint8_t *payload,
     int rc;
 
 #if MYNEWT_VAL(BUS_DRIVER_PRESENT)
-    struct os_dev *dev = SENSOR_ITF_GET_DEVICE(itf);
+    struct os_dev *dev = itf->si_dev;
 
     rc = bus_node_lock(dev, OS_TIMEOUT_NEVER);
     if (rc) {