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

 ##########
 File path: hw/drivers/sensors/lis2dw12/src/lis2dw12.c
 ##########
 @@ -2052,18 +2332,22 @@ lis2dw12_sensor_unset_notification(struct sensor 
*sensor, sensor_event_type_t ty
     struct lis2dw12 * lis2dw12;
     struct sensor_itf *itf;
     int rc;
+    uint8_t int_cfg = 0;
     
-    if ((type & ~(SENSOR_EVENT_TYPE_DOUBLE_TAP |
-                  SENSOR_EVENT_TYPE_SINGLE_TAP)) != 0) {
-        return SYS_EINVAL;
+    if(type == SENSOR_EVENT_TYPE_DOUBLE_TAP) {
+        int_cfg |= LIS2DW12_INT1_CFG_DOUBLE_TAP;
     }
-    
-    /*XXX for now we do not support registering for both events */
-    if (type == (SENSOR_EVENT_TYPE_DOUBLE_TAP |
-                 SENSOR_EVENT_TYPE_SINGLE_TAP)) {
+    else if(type == SENSOR_EVENT_TYPE_SINGLE_TAP) {
 
 Review comment:
   As per our coding style, <else if> should be on the same line as < } > and < 
{ >.  

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to