mkiiskila commented on a change in pull request #1088: fix self test
URL: https://github.com/apache/mynewt-core/pull/1088#discussion_r188520768
 
 

 ##########
 File path: hw/drivers/sensors/lis2dw12/src/lis2dw12.c
 ##########
 @@ -1909,14 +1909,11 @@ int lis2dw12_run_self_test(struct sensor_itf *itf, int 
*result)
 
     /* calculate accel data difference */
     change = 0;
+    *result = 0;
     for(i = 0; i < 3; i++) {
-        change += pos[i] - base[i];
-    }
-
-    if ((change > 70) && (change < 1500)) {
-        *result = 0;
-    } else {
-        *result = -1;
+       change = pos[i] - base[i];
+       if(!(change > 70) && (change < 1500))
 
 Review comment:
   Coding style: need whitespace after 'if'. More importantly: even single line 
statements after if-conditions must be wrapped with { }.

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