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 2019/04/22 19:12:01 UTC

[mynewt-core] branch master updated: lps33hw/lps33thw: Fix sensor usage of non-default event queue (#1777)

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 de65fc0  lps33hw/lps33thw: Fix sensor usage of non-default event queue (#1777)
de65fc0 is described below

commit de65fc04f1a620f5e4f138bd6dcd19a6c1cf6a9a
Author: Ben McCrea <be...@pachinkolabs.com>
AuthorDate: Mon Apr 22 12:11:56 2019 -0700

    lps33hw/lps33thw: Fix sensor usage of non-default event queue (#1777)
    
    - Sensor one-shot callouts should use same queue as sensor layer
---
 hw/drivers/sensors/lps33hw/src/lps33hw.c   | 2 +-
 hw/drivers/sensors/lps33thw/src/lps33thw.c | 4 ++--
 hw/sensor/src/sensor.c                     | 7 ++++++-
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/hw/drivers/sensors/lps33hw/src/lps33hw.c b/hw/drivers/sensors/lps33hw/src/lps33hw.c
index a2d9e9b..8fb9246 100644
--- a/hw/drivers/sensors/lps33hw/src/lps33hw.c
+++ b/hw/drivers/sensors/lps33hw/src/lps33hw.c
@@ -938,7 +938,7 @@ lps33hw_init(struct os_dev *dev, void *arg)
 
     lps = (struct lps33hw *) dev;
 #if MYNEWT_VAL(LPS33HW_ONE_SHOT_MODE)
-    os_callout_init(&lps->lps33hw_one_shot_read, os_eventq_dflt_get(), lps33hw_one_shot_read_cb, dev);
+    os_callout_init(&lps->lps33hw_one_shot_read, sensor_mgr_evq_get(), lps33hw_one_shot_read_cb, dev);
 #endif
 
     sensor = &lps->sensor;
diff --git a/hw/drivers/sensors/lps33thw/src/lps33thw.c b/hw/drivers/sensors/lps33thw/src/lps33thw.c
index 52adc68..d823c27 100644
--- a/hw/drivers/sensors/lps33thw/src/lps33thw.c
+++ b/hw/drivers/sensors/lps33thw/src/lps33thw.c
@@ -542,7 +542,7 @@ int
 lps33thw_reset(struct sensor *sensor)
 {
     struct sensor_itf *itf;
-     
+
     itf = SENSOR_GET_ITF(sensor);
 
     return lps33thw_set_reg(itf, LPS33THW_CTRL_REG2, 0x04);
@@ -937,7 +937,7 @@ lps33thw_init(struct os_dev *dev, void *arg)
 
     lps = (struct lps33thw *) dev;
 #if MYNEWT_VAL(LPS33THW_ONE_SHOT_MODE)
-    os_callout_init(&lps->lps33thw_one_shot_read, os_eventq_dflt_get(), lps33thw_one_shot_read_cb, dev);
+    os_callout_init(&lps->lps33thw_one_shot_read, sensor_mgr_evq_get(), lps33thw_one_shot_read_cb, dev);
 #endif
 
     sensor = &lps->sensor;
diff --git a/hw/sensor/src/sensor.c b/hw/sensor/src/sensor.c
index 19714b8..55e2aee 100644
--- a/hw/sensor/src/sensor.c
+++ b/hw/sensor/src/sensor.c
@@ -35,6 +35,11 @@
 #include "sensor/gyro.h"
 #include "console/console.h"
 
+#ifdef MYNEWT_VAL_SENSOR_MGR_EVQ
+extern struct os_eventq MYNEWT_VAL(SENSOR_MGR_EVQ);
+#endif
+
+
 #if MYNEWT_VAL(SENSOR_POLL_TEST_LOG)
 uint32_t test_log_idx;
 uint32_t smgr_wakeup_idx;
@@ -646,7 +651,7 @@ sensor_mgr_init(void)
     int rc;
 
 #ifdef MYNEWT_VAL_SENSOR_MGR_EVQ
-    sensor_mgr_evq_set(MYNEWT_VAL(SENSOR_MGR_EVQ));
+    sensor_mgr_evq_set(&MYNEWT_VAL(SENSOR_MGR_EVQ));
 #else
     sensor_mgr_evq_set(os_eventq_dflt_get());
 #endif