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/04/09 20:21:51 UTC

[GitHub] vrahane commented on a change in pull request #997: WIP: Improvements to LIS2DW12 driver

vrahane commented on a change in pull request #997: WIP: Improvements to LIS2DW12 driver
URL: https://github.com/apache/mynewt-core/pull/997#discussion_r180217777
 
 

 ##########
 File path: hw/drivers/sensors/lis2dw12/src/lis2dw12.c
 ##########
 @@ -1991,13 +2276,15 @@ lis2dw12_sensor_set_notification(struct sensor *sensor, sensor_event_type_t type
     int rc;
 
     if ((type & ~(SENSOR_EVENT_TYPE_DOUBLE_TAP |
-                  SENSOR_EVENT_TYPE_SINGLE_TAP)) != 0) {
+                  SENSOR_EVENT_TYPE_SINGLE_TAP |
+                  SENSOR_EVENT_TYPE_FREE_FALL)) != 0) {
         return SYS_EINVAL;
     }
 
-    /*XXX for now we do not support registering for both events */
+    /*XXX for now we do not support registering for more than 1 event */
     if (type == (SENSOR_EVENT_TYPE_DOUBLE_TAP |
-                 SENSOR_EVENT_TYPE_SINGLE_TAP)) {
+                 SENSOR_EVENT_TYPE_SINGLE_TAP |
+                 SENSOR_EVENT_TYPE_FREE_FALL)) {
 
 Review comment:
   This check assumes all events will be enabled. I think the check needs to be changed to something that checks for more than one events. Maybe the two if statements can be combined ?

----------------------------------------------------------------
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