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 2019/09/04 06:50:28 UTC

[mynewt-core] 01/03: sensors/lsm6dso: Fix bus driver build

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 1a11b66e0b553db4229f87c45db3e61957f14e77
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Mon Sep 2 15:01:07 2019 +0200

    sensors/lsm6dso: Fix bus driver build
    
    Two minor changes:
    - device creation functions were not exported
    - two warnings fixed (unused variable and label)
---
 hw/drivers/sensors/lsm6dso/include/lsm6dso/lsm6dso.h | 11 +++++++++++
 hw/drivers/sensors/lsm6dso/src/lsm6dso.c             |  3 +--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/hw/drivers/sensors/lsm6dso/include/lsm6dso/lsm6dso.h b/hw/drivers/sensors/lsm6dso/include/lsm6dso/lsm6dso.h
index 3f86e31..168d3e8 100644
--- a/hw/drivers/sensors/lsm6dso/include/lsm6dso/lsm6dso.h
+++ b/hw/drivers/sensors/lsm6dso/include/lsm6dso/lsm6dso.h
@@ -348,6 +348,17 @@ lsm6dso_get_ag_data(struct sensor_itf *itf, sensor_type_t type, void *data,
  */
 int lsm6dso_run_self_test(struct sensor_itf *itf, int *result);
 
+#if MYNEWT_VAL(BUS_DRIVER_PRESENT)
+int lsm6dso_create_i2c_sensor_dev(struct bus_i2c_node *node, const char *name,
+                                  const struct bus_i2c_node_cfg *i2c_cfg,
+                                  struct sensor_itf *sensor_itf);
+
+int lsm6dso_create_spi_sensor_dev(struct bus_spi_node *node, const char *name,
+                                  const struct bus_spi_node_cfg *spi_cfg,
+                                  struct sensor_itf *sensor_itf);
+
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/hw/drivers/sensors/lsm6dso/src/lsm6dso.c b/hw/drivers/sensors/lsm6dso/src/lsm6dso.c
index e404b1d..1c003fe 100644
--- a/hw/drivers/sensors/lsm6dso/src/lsm6dso.c
+++ b/hw/drivers/sensors/lsm6dso/src/lsm6dso.c
@@ -383,7 +383,6 @@ int lsm6dso_writelen(struct sensor_itf *itf, uint8_t addr,
          */
         uint8_t payload[19];
     } write_data;
-    struct lsm6dso *dev = (struct lsm6dso *)itf->si_dev;
 
     if (len > sizeof(write_data.payload)) {
         return -1;
@@ -406,9 +405,9 @@ int lsm6dso_writelen(struct sensor_itf *itf, uint8_t addr,
     }
 
     sensor_itf_unlock(itf);
+err:
 #endif /* BUS_DRIVER_PRESENT */
 
-err:
     return rc;
 }