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 2018/03/27 01:50:35 UTC

[mynewt-core] branch master updated: lis2dw12: Add set_config function (#960)

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 1fb971a  lis2dw12: Add set_config function (#960)
1fb971a is described below

commit 1fb971ac1e877c378e892c34bcadb48c45fc38ff
Author: Vipul Rahane <vr...@gmail.com>
AuthorDate: Mon Mar 26 18:50:34 2018 -0700

    lis2dw12: Add set_config function (#960)
---
 hw/drivers/sensors/lis2dw12/src/lis2dw12.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/hw/drivers/sensors/lis2dw12/src/lis2dw12.c b/hw/drivers/sensors/lis2dw12/src/lis2dw12.c
index eff9719..2dd04e8 100644
--- a/hw/drivers/sensors/lis2dw12/src/lis2dw12.c
+++ b/hw/drivers/sensors/lis2dw12/src/lis2dw12.c
@@ -74,13 +74,15 @@ static int lis2dw12_sensor_set_notification(struct sensor *,
 static int lis2dw12_sensor_unset_notification(struct sensor *,
                                               sensor_event_type_t);
 static int lis2dw12_sensor_handle_interrupt(struct sensor *);
+static int lis2dw12_sensor_set_config(struct sensor *, void *);
 
 static const struct sensor_driver g_lis2dw12_sensor_driver = {
-    .sd_read = lis2dw12_sensor_read,
-    .sd_get_config = lis2dw12_sensor_get_config,
-    .sd_set_notification = lis2dw12_sensor_set_notification,
+    .sd_read               = lis2dw12_sensor_read,
+    .sd_set_config         = lis2dw12_sensor_set_config,
+    .sd_get_config         = lis2dw12_sensor_get_config,
+    .sd_set_notification   = lis2dw12_sensor_set_notification,
     .sd_unset_notification = lis2dw12_sensor_unset_notification,
-    .sd_handle_interrupt = lis2dw12_sensor_handle_interrupt
+    .sd_handle_interrupt   = lis2dw12_sensor_handle_interrupt
 
 };
 
@@ -1722,6 +1724,16 @@ lis2dw12_sensor_set_notification(struct sensor *sensor, sensor_event_type_t type
 }
 
 static int
+lis2dw12_sensor_set_config(struct sensor *sensor, void *cfg)
+{
+    struct lis2dw12 *lis2dw12;
+
+    lis2dw12 = (struct lis2dw12 *)SENSOR_GET_DEVICE(sensor);
+
+    return lis2dw12_config(lis2dw12, (struct lis2dw12_cfg*)cfg);
+}
+
+static int
 lis2dw12_sensor_unset_notification(struct sensor *sensor, sensor_event_type_t type)
 {
     struct lis2dw12 * lis2dw12;

-- 
To stop receiving notification emails like this one, please contact
vipulrahane@apache.org.