You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/03/27 01:50:35 UTC
[GitHub] vrahane closed pull request #960: lis2dw12: Add set_config function
vrahane closed pull request #960: lis2dw12: Add set_config function
URL: https://github.com/apache/mynewt-core/pull/960
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/hw/drivers/sensors/lis2dw12/src/lis2dw12.c b/hw/drivers/sensors/lis2dw12/src/lis2dw12.c
index eff9719e5..2dd04e868 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
};
@@ -1721,6 +1723,16 @@ lis2dw12_sensor_set_notification(struct sensor *sensor, sensor_event_type_t type
return 0;
}
+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)
{
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services