You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by vi...@apache.org on 2017/07/18 20:55:05 UTC

[mynewt-core] branch master updated: Fix build for apps/sensors_test with no syscfg set

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

vipulrahane 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 b2d5987  Fix build for apps/sensors_test with no syscfg set
b2d5987 is described below

commit b2d5987d07fb8a07273a8701202ee13124d2a025
Author: Vipul Rahane <vi...@apache.org>
AuthorDate: Tue Jul 18 13:47:53 2017 -0700

    Fix build for apps/sensors_test with no syscfg set
---
 hw/bsp/nrf52-thingy/src/hal_bsp.c    |  6 +++---
 hw/bsp/ruuvi_tag_revb2/src/hal_bsp.c | 14 ++++++++------
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/hw/bsp/nrf52-thingy/src/hal_bsp.c b/hw/bsp/nrf52-thingy/src/hal_bsp.c
index 72ef382..3a6f8a4 100644
--- a/hw/bsp/nrf52-thingy/src/hal_bsp.c
+++ b/hw/bsp/nrf52-thingy/src/hal_bsp.c
@@ -171,10 +171,10 @@ hal_bsp_get_nvic_priority(int irq_num, uint32_t pri)
  *
  * @return 0 on success, non-zero on failure
  */
-#if MYNEWT_VAL(LIS2DH12_ONB)
 int
 config_lis2dh12_sensor(void)
 {
+#if MYNEWT_VAL(LIS2DH12_ONB)
     int rc;
     struct os_dev *dev;
     struct lis2dh12_cfg cfg;
@@ -193,9 +193,9 @@ config_lis2dh12_sensor(void)
     SYSINIT_PANIC_ASSERT(rc == 0);
 
     os_dev_close(dev);
-    return rc;
-}
 #endif
+    return 0;
+}
 
 static void
 sensor_dev_create(HN_1344HZ_L_5376HZ)
diff --git a/hw/bsp/ruuvi_tag_revb2/src/hal_bsp.c b/hw/bsp/ruuvi_tag_revb2/src/hal_bsp.c
index 945589e..d74fc5c 100644
--- a/hw/bsp/ruuvi_tag_revb2/src/hal_bsp.c
+++ b/hw/bsp/ruuvi_tag_revb2/src/hal_bsp.c
@@ -184,10 +184,10 @@ hal_bsp_get_nvic_priority(int irq_num, uint32_t pri)
  *
  * @return 0 on success, non-zero on failure
  */
-#if MYNEWT_VAL(BME280_ONB)
 int
 config_bme280_sensor(void)
 {
+#if MYNEWT_VAL(BME280_ONB)
     int rc;
     struct os_dev *dev;
     struct bme280_cfg bmecfg;
@@ -211,21 +211,22 @@ config_bme280_sensor(void)
                        SENSOR_TYPE_RELATIVE_HUMIDITY;
 
     rc = bme280_config((struct bme280 *)dev, &bmecfg);
+    SYSINIT_PANIC_ASSERT(rc == 0);
 
     os_dev_close(dev);
-    return rc;
-}
 #endif
+    return 0;
+}
 
 /**
  * LIS2Dh12 Sensor default configuration
  *
  * @return 0 on success, non-zero on failure
  */
-#if MYNEWT_VAL(LIS2DH12_ONB)
 int
 config_lis2dh12_sensor(void)
 {
+#if MYNEWT_VAL(LIS2DH12_ONB)
     int rc;
     struct os_dev *dev;
     struct lis2dh12_cfg cfg;
@@ -240,11 +241,12 @@ config_lis2dh12_sensor(void)
     cfg.lc_fs = LIS2DH12_FS_2G;
 
     rc = lis2dh12_config((struct lis2dh12 *)dev, &cfg);
+    SYSINIT_PANIC_ASSERT(rc == 0);
 
     os_dev_close(dev);
-    return rc;
-}
 #endif
+    return 0;
+}
 
 static void
 sensor_dev_create(void)

-- 
To stop receiving notification emails like this one, please contact
['"commits@mynewt.apache.org" <co...@mynewt.apache.org>'].