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 2022/06/10 19:51:31 UTC

[GitHub] [mynewt-core] JustineKH opened a new pull request, #2849: sensors/lsm6dsl: add tilt function

JustineKH opened a new pull request, #2849:
URL: https://github.com/apache/mynewt-core/pull/2849

   Adding absolute and relative tilt functionality.
   Extending lsm6dsl_shell dump to include bankA and bankB registers.
   Fixed LSM6DSL_SHUB_REG_ACCESS_MASK bit mask.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2849: sensors/lsm6dsl: add tilt function

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on PR #2849:
URL: https://github.com/apache/mynewt-core/pull/2849#issuecomment-1152832570

   
   <!-- style-bot -->
   
   ## Style check summary
   
   ### Our coding style is [here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
   #### hw/drivers/sensors/lsm6dsl/include/lsm6dsl/lsm6dsl.h
   <details>
   
   ```diff
   @@ -120,10 +120,10 @@
    
    struct lsm6dsl_tap_settings {
        /* Axis enabled bitmask */
   -    uint8_t en_x: 1;
   -    uint8_t en_y: 1;
   -    uint8_t en_z: 1;
   -    uint8_t en_dtap: 1;
   +    uint8_t en_x : 1;
   +    uint8_t en_y : 1;
   +    uint8_t en_z : 1;
   +    uint8_t en_dtap : 1;
    
        /* Threshold for tap recognition */
        int8_t tap_ths;
   ```
   
   </details>
   
   #### hw/drivers/sensors/lsm6dsl/src/lsm6dsl.c
   <details>
   
   ```diff
   @@ -103,35 +103,35 @@
    
    /* Define the stats section and records */
    STATS_SECT_START(lsm6dsl_stat_section)
   -    STATS_SECT_ENTRY(write_errors)
   -    STATS_SECT_ENTRY(read_errors)
   +STATS_SECT_ENTRY(write_errors)
   +STATS_SECT_ENTRY(read_errors)
    #if MYNEWT_VAL(LSM6DSL_NOTIF_STATS)
   -    STATS_SECT_ENTRY(single_tap_notify)
   -    STATS_SECT_ENTRY(double_tap_notify)
   -    STATS_SECT_ENTRY(free_fall_notify)
   -    STATS_SECT_ENTRY(rel_tilt_notify)
   -    STATS_SECT_ENTRY(abs_tilt_pos_notify)
   -    STATS_SECT_ENTRY(abs_tilt_neg_notify)
   -    STATS_SECT_ENTRY(sleep_notify)
   -    STATS_SECT_ENTRY(orientation_notify)
   -    STATS_SECT_ENTRY(wakeup_notify)
   +STATS_SECT_ENTRY(single_tap_notify)
   +STATS_SECT_ENTRY(double_tap_notify)
   +STATS_SECT_ENTRY(free_fall_notify)
   +STATS_SECT_ENTRY(rel_tilt_notify)
   +STATS_SECT_ENTRY(abs_tilt_pos_notify)
   +STATS_SECT_ENTRY(abs_tilt_neg_notify)
   +STATS_SECT_ENTRY(sleep_notify)
   +STATS_SECT_ENTRY(orientation_notify)
   +STATS_SECT_ENTRY(wakeup_notify)
    #endif /* LSM6DSL_NOTIF_STATS */
    STATS_SECT_END
    
    /* Define stat names for querying */
    STATS_NAME_START(lsm6dsl_stat_section)
   -    STATS_NAME(lsm6dsl_stat_section, write_errors)
   -    STATS_NAME(lsm6dsl_stat_section, read_errors)
   +STATS_NAME(lsm6dsl_stat_section, write_errors)
   +STATS_NAME(lsm6dsl_stat_section, read_errors)
    #if MYNEWT_VAL(LSM6DSL_NOTIF_STATS)
   -    STATS_NAME(lsm6dsl_stat_section, single_tap_notify)
   -    STATS_NAME(lsm6dsl_stat_section, double_tap_notify)
   -    STATS_NAME(lsm6dsl_stat_section, rel_tilt_notify)
   -    STATS_NAME(lsm6dsl_stat_section, abs_tilt_pos_notify)
   -    STATS_NAME(lsm6dsl_stat_section, abs_tilt_neg_notify)
   -    STATS_NAME(lsm6dsl_stat_section, free_fall_notify)
   -    STATS_NAME(lsm6dsl_stat_section, sleep_notify)
   -    STATS_NAME(lsm6dsl_stat_section, orientation_notify)
   -    STATS_NAME(lsm6dsl_stat_section, wakeup_notify)
   +STATS_NAME(lsm6dsl_stat_section, single_tap_notify)
   +STATS_NAME(lsm6dsl_stat_section, double_tap_notify)
   +STATS_NAME(lsm6dsl_stat_section, rel_tilt_notify)
   +STATS_NAME(lsm6dsl_stat_section, abs_tilt_pos_notify)
   +STATS_NAME(lsm6dsl_stat_section, abs_tilt_neg_notify)
   +STATS_NAME(lsm6dsl_stat_section, free_fall_notify)
   +STATS_NAME(lsm6dsl_stat_section, sleep_notify)
   +STATS_NAME(lsm6dsl_stat_section, orientation_notify)
   +STATS_NAME(lsm6dsl_stat_section, wakeup_notify)
    #endif /* LSM6DSL_NOTIFY_STATS */
    STATS_NAME_END(lsm6dsl_stat_section)
    
   @@ -1036,7 +1036,7 @@
    
    int
    lsm6dsl_set_tilt(struct lsm6dsl *lsm6dsl,
   -                        const struct lsm6dsl_tilt_settings *cfg)
   +                 const struct lsm6dsl_tilt_settings *cfg)
    {
        int rc;
        uint8_t en_mask;
   @@ -1049,7 +1049,8 @@
                return rc;
            }
            if (cfg->en_wrist_tilt) {
   -            rc = lsm6dsl_write_reg(lsm6dsl, LSM6DSL_FUNC_CFG_ACCESS_REG, LSM6DSL_FUNC_CFG_ACCESS_MASK | LSM6DSL_SHUB_REG_ACCESS_MASK);
   +            rc = lsm6dsl_write_reg(lsm6dsl, LSM6DSL_FUNC_CFG_ACCESS_REG,
   +                                   LSM6DSL_FUNC_CFG_ACCESS_MASK | LSM6DSL_SHUB_REG_ACCESS_MASK);
                if (rc) {
                    return rc;
                }
   @@ -2221,35 +2224,35 @@
    {
    #if MYNEWT_VAL(LSM6DSL_NOTIF_STATS)
        switch (event) {
   -        case SENSOR_EVENT_TYPE_SINGLE_TAP:
   -            STATS_INC(g_lsm6dsl_stats, single_tap_notify);
   -            break;
   -        case SENSOR_EVENT_TYPE_DOUBLE_TAP:
   -            STATS_INC(g_lsm6dsl_stats, double_tap_notify);
   -            break;
   -        case SENSOR_EVENT_TYPE_ORIENT_CHANGE:
   -            STATS_INC(g_lsm6dsl_stats, orientation_notify);
   -            break;
   -        case SENSOR_EVENT_TYPE_SLEEP:
   -            STATS_INC(g_lsm6dsl_stats, sleep_notify);
   -            break;
   -        case SENSOR_EVENT_TYPE_WAKEUP:
   -            STATS_INC(g_lsm6dsl_stats, wakeup_notify);
   -            break;
   -        case SENSOR_EVENT_TYPE_FREE_FALL:
   -            STATS_INC(g_lsm6dsl_stats, free_fall_notify);
   -            break;
   -        case SENSOR_EVENT_TYPE_TILT_CHANGE:
   -            STATS_INC(g_lsm6dsl_stats, rel_tilt_notify);
   -            break;
   -        case SENSOR_EVENT_TYPE_TILT_POS:
   -            STATS_INC(g_lsm6dsl_stats, abs_tilt_pos_notify);
   -            break;
   -        case SENSOR_EVENT_TYPE_TILT_NEG:
   -            STATS_INC(g_lsm6dsl_stats, abs_tilt_neg_notify);
   -            break;
   -        default:
   -            break;
   +    case SENSOR_EVENT_TYPE_SINGLE_TAP:
   +        STATS_INC(g_lsm6dsl_stats, single_tap_notify);
   +        break;
   +    case SENSOR_EVENT_TYPE_DOUBLE_TAP:
   +        STATS_INC(g_lsm6dsl_stats, double_tap_notify);
   +        break;
   +    case SENSOR_EVENT_TYPE_ORIENT_CHANGE:
   +        STATS_INC(g_lsm6dsl_stats, orientation_notify);
   +        break;
   +    case SENSOR_EVENT_TYPE_SLEEP:
   +        STATS_INC(g_lsm6dsl_stats, sleep_notify);
   +        break;
   +    case SENSOR_EVENT_TYPE_WAKEUP:
   +        STATS_INC(g_lsm6dsl_stats, wakeup_notify);
   +        break;
   +    case SENSOR_EVENT_TYPE_FREE_FALL:
   +        STATS_INC(g_lsm6dsl_stats, free_fall_notify);
   +        break;
   +    case SENSOR_EVENT_TYPE_TILT_CHANGE:
   +        STATS_INC(g_lsm6dsl_stats, rel_tilt_notify);
   +        break;
   +    case SENSOR_EVENT_TYPE_TILT_POS:
   +        STATS_INC(g_lsm6dsl_stats, abs_tilt_pos_notify);
   +        break;
   +    case SENSOR_EVENT_TYPE_TILT_NEG:
   +        STATS_INC(g_lsm6dsl_stats, abs_tilt_neg_notify);
   +        break;
   +    default:
   +        break;
        }
    #endif /* LSM6DSL_NOTIF_STATS */
    }
   ```
   
   </details>
   
   #### hw/drivers/sensors/lsm6dsl/src/lsm6dsl_shell.c
   <details>
   
   ```diff
   @@ -197,7 +198,7 @@
                rc = lsm6dsl_read(g_lsm6dsl, reg_name_banka[i].addr, &value, 1);
                if (rc) {
                    console_printf("dump failed %d\n", rc);
   -            } else if (all || value != 0){
   +            } else if (all || value != 0) {
                    console_printf("%-22s(0x%02X) = 0x%02X\n",
                                   reg_name_banka[i].regname, reg_name_banka[i].addr, value);
                }
   @@ -208,7 +209,8 @@
            }
    
            /* Bank B */
   -        rc = lsm6dsl_write_reg(g_lsm6dsl, LSM6DSL_FUNC_CFG_ACCESS_REG, LSM6DSL_FUNC_CFG_ACCESS_MASK | LSM6DSL_SHUB_REG_ACCESS_MASK);
   +        rc = lsm6dsl_write_reg(g_lsm6dsl, LSM6DSL_FUNC_CFG_ACCESS_REG,
   +                               LSM6DSL_FUNC_CFG_ACCESS_MASK | LSM6DSL_SHUB_REG_ACCESS_MASK);
            if (rc) {
                return rc;
            }
   @@ -216,7 +218,7 @@
                rc = lsm6dsl_read(g_lsm6dsl, reg_name_bankb[i].addr, &value, 1);
                if (rc) {
                    console_printf("dump failed %d\n", rc);
   -            } else if (all || value != 0){
   +            } else if (all || value != 0) {
                    console_printf("%-22s(0x%02X) = 0x%02X\n",
                                   reg_name_bankb[i].regname, reg_name_bankb[i].addr, value);
                }
   ```
   
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2849: sensors/lsm6dsl: add tilt function

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on PR #2849:
URL: https://github.com/apache/mynewt-core/pull/2849#issuecomment-1156684742

   
   <!-- style-bot -->
   
   ## Style check summary
   
   ### Our coding style is [here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
   #### hw/drivers/sensors/lsm6dsl/src/lsm6dsl.c
   <details>
   
   ```diff
   @@ -103,35 +103,35 @@
    
    /* Define the stats section and records */
    STATS_SECT_START(lsm6dsl_stat_section)
   -    STATS_SECT_ENTRY(write_errors)
   -    STATS_SECT_ENTRY(read_errors)
   +STATS_SECT_ENTRY(write_errors)
   +STATS_SECT_ENTRY(read_errors)
    #if MYNEWT_VAL(LSM6DSL_NOTIF_STATS)
   -    STATS_SECT_ENTRY(single_tap_notify)
   -    STATS_SECT_ENTRY(double_tap_notify)
   -    STATS_SECT_ENTRY(free_fall_notify)
   -    STATS_SECT_ENTRY(rel_tilt_notify)
   -    STATS_SECT_ENTRY(abs_tilt_pos_notify)
   -    STATS_SECT_ENTRY(abs_tilt_neg_notify)
   -    STATS_SECT_ENTRY(sleep_notify)
   -    STATS_SECT_ENTRY(orientation_notify)
   -    STATS_SECT_ENTRY(wakeup_notify)
   +STATS_SECT_ENTRY(single_tap_notify)
   +STATS_SECT_ENTRY(double_tap_notify)
   +STATS_SECT_ENTRY(free_fall_notify)
   +STATS_SECT_ENTRY(rel_tilt_notify)
   +STATS_SECT_ENTRY(abs_tilt_pos_notify)
   +STATS_SECT_ENTRY(abs_tilt_neg_notify)
   +STATS_SECT_ENTRY(sleep_notify)
   +STATS_SECT_ENTRY(orientation_notify)
   +STATS_SECT_ENTRY(wakeup_notify)
    #endif /* LSM6DSL_NOTIF_STATS */
    STATS_SECT_END
    
    /* Define stat names for querying */
    STATS_NAME_START(lsm6dsl_stat_section)
   -    STATS_NAME(lsm6dsl_stat_section, write_errors)
   -    STATS_NAME(lsm6dsl_stat_section, read_errors)
   +STATS_NAME(lsm6dsl_stat_section, write_errors)
   +STATS_NAME(lsm6dsl_stat_section, read_errors)
    #if MYNEWT_VAL(LSM6DSL_NOTIF_STATS)
   -    STATS_NAME(lsm6dsl_stat_section, single_tap_notify)
   -    STATS_NAME(lsm6dsl_stat_section, double_tap_notify)
   -    STATS_NAME(lsm6dsl_stat_section, rel_tilt_notify)
   -    STATS_NAME(lsm6dsl_stat_section, abs_tilt_pos_notify)
   -    STATS_NAME(lsm6dsl_stat_section, abs_tilt_neg_notify)
   -    STATS_NAME(lsm6dsl_stat_section, free_fall_notify)
   -    STATS_NAME(lsm6dsl_stat_section, sleep_notify)
   -    STATS_NAME(lsm6dsl_stat_section, orientation_notify)
   -    STATS_NAME(lsm6dsl_stat_section, wakeup_notify)
   +STATS_NAME(lsm6dsl_stat_section, single_tap_notify)
   +STATS_NAME(lsm6dsl_stat_section, double_tap_notify)
   +STATS_NAME(lsm6dsl_stat_section, rel_tilt_notify)
   +STATS_NAME(lsm6dsl_stat_section, abs_tilt_pos_notify)
   +STATS_NAME(lsm6dsl_stat_section, abs_tilt_neg_notify)
   +STATS_NAME(lsm6dsl_stat_section, free_fall_notify)
   +STATS_NAME(lsm6dsl_stat_section, sleep_notify)
   +STATS_NAME(lsm6dsl_stat_section, orientation_notify)
   +STATS_NAME(lsm6dsl_stat_section, wakeup_notify)
    #endif /* LSM6DSL_NOTIFY_STATS */
    STATS_NAME_END(lsm6dsl_stat_section)
    
   ```
   
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2849: sensors/lsm6dsl: add tilt function

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on PR #2849:
URL: https://github.com/apache/mynewt-core/pull/2849#issuecomment-1154591205

   
   <!-- style-bot -->
   
   ## Style check summary
   
   #### No suggestions at this time!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [mynewt-core] kasjer commented on a diff in pull request #2849: sensors/lsm6dsl: add tilt function

Posted by GitBox <gi...@apache.org>.
kasjer commented on code in PR #2849:
URL: https://github.com/apache/mynewt-core/pull/2849#discussion_r897346720


##########
hw/drivers/sensors/lsm6dsl/src/lsm6dsl_shell.c:
##########
@@ -80,6 +80,21 @@ static const reg_name_t reg_name[] = {
     { .addr = 0x5f, .regname = "MD2_CFG" },
 };
 
+/* Human readable register map for bankA */
+static const reg_name_t reg_name_banka[] = {
+    { .addr = 0x0f, .regname = "CONFIG_PEDO_THS_MIN" },
+    { .addr = 0x13, .regname = "SM_THS" },
+    { .addr = 0x14, .regname = "PEDO_DEB_REG" },
+    { .addr = 0x15, .regname = "STEP_COINT_DELTA" },

Review Comment:
   STEP_COUNT_DELTA



##########
hw/drivers/sensors/lsm6dsl/src/lsm6dsl.c:
##########
@@ -817,7 +841,19 @@ lsm6dsl_clear_int(struct lsm6dsl *lsm6dsl, struct int_src_regs *int_src)
      * if wake_up_src is read first D6D_IA bit from D6D_SRC is cleared
      * and information about orientation change is lost.
      */
-    rc = lsm6dsl_read(lsm6dsl, LSM6DSL_D6D_SRC_REG, (uint8_t *)&int_src->d6d_src, 2);
+    rc = lsm6dsl_read(lsm6dsl, LSM6DSL_D6D_SRC_REG, (uint8_t *)&int_src->d6d_src, 1);
+    if (rc == 0) {
+        rc = lsm6dsl_read(lsm6dsl, LSM6DSL_TAP_SRC_REG, (uint8_t *)&int_src->tap_src, 1);
+    }
+    if (rc == 0) {
+        rc = lsm6dsl_read(lsm6dsl, LSM6DSL_A_WRIST_TILT_IA_REG, (uint8_t *)&int_src->wrist_tilt_ia, 1);
+    }
+    if (rc == 0) {
+        rc = lsm6dsl_read(lsm6dsl, LSM6DSL_FUNC_SRC2_REG, (uint8_t *)&int_src->func_src2, 1);
+    }
+    if (rc == 0) {
+        rc = lsm6dsl_read(lsm6dsl, LSM6DSL_FUNC_SRC1_REG, (uint8_t *)&int_src->func_src1, 1);
+    }
     if (rc == 0) {
         rc = lsm6dsl_read(lsm6dsl, LSM6DSL_WAKE_UP_SRC_REG, (uint8_t *)&int_src->wake_up_src, 2);
     }

Review Comment:
   Originally I had code that read WAKE_UP_SRC (0x1B), TAP_SRC (0x1C), D6D_SRC (0x1D), STATUS_REG (0x1E) in single I2C transaction.
   It turned out that while reading WAKE_UP_SRC value that was present in STATUS_REG prior to read was cleared.
   That's why read was split into two reads each for 2 bytes.
   Now D6D_SRC is read as one byte, STATUS_REG is not read and TAP_SRC is read twice once into tap_src filed and second time in read into wake_up_src.
   I did not check wrist_tilt_ia, func_src2, func_src1 but maybe those also could be arranged in int_src_regs in order that allows to read them in single 3 byte I2C transaction.



##########
hw/drivers/sensors/lsm6dsl/src/lsm6dsl.c:
##########
@@ -103,35 +103,35 @@ static const struct lsm6dsl_notif_cfg default_notif_cfg[] = {
 
 /* Define the stats section and records */
 STATS_SECT_START(lsm6dsl_stat_section)
-    STATS_SECT_ENTRY(write_errors)
-    STATS_SECT_ENTRY(read_errors)
+STATS_SECT_ENTRY(write_errors)
+STATS_SECT_ENTRY(read_errors)
 #if MYNEWT_VAL(LSM6DSL_NOTIF_STATS)
-    STATS_SECT_ENTRY(single_tap_notify)
-    STATS_SECT_ENTRY(double_tap_notify)
-    STATS_SECT_ENTRY(free_fall_notify)
-    STATS_SECT_ENTRY(rel_tilt_notify)
-    STATS_SECT_ENTRY(abs_tilt_pos_notify)
-    STATS_SECT_ENTRY(abs_tilt_neg_notify)
-    STATS_SECT_ENTRY(sleep_notify)
-    STATS_SECT_ENTRY(orientation_notify)
-    STATS_SECT_ENTRY(wakeup_notify)
+STATS_SECT_ENTRY(single_tap_notify)
+STATS_SECT_ENTRY(double_tap_notify)
+STATS_SECT_ENTRY(free_fall_notify)
+STATS_SECT_ENTRY(rel_tilt_notify)
+STATS_SECT_ENTRY(abs_tilt_pos_notify)
+STATS_SECT_ENTRY(abs_tilt_neg_notify)
+STATS_SECT_ENTRY(sleep_notify)
+STATS_SECT_ENTRY(orientation_notify)
+STATS_SECT_ENTRY(wakeup_notify)
 #endif /* LSM6DSL_NOTIF_STATS */
 STATS_SECT_END
 
 /* Define stat names for querying */
 STATS_NAME_START(lsm6dsl_stat_section)
-    STATS_NAME(lsm6dsl_stat_section, write_errors)
-    STATS_NAME(lsm6dsl_stat_section, read_errors)
+STATS_NAME(lsm6dsl_stat_section, write_errors)
+STATS_NAME(lsm6dsl_stat_section, read_errors)
 #if MYNEWT_VAL(LSM6DSL_NOTIF_STATS)
-    STATS_NAME(lsm6dsl_stat_section, single_tap_notify)
-    STATS_NAME(lsm6dsl_stat_section, double_tap_notify)
-    STATS_NAME(lsm6dsl_stat_section, rel_tilt_notify)
-    STATS_NAME(lsm6dsl_stat_section, abs_tilt_pos_notify)
-    STATS_NAME(lsm6dsl_stat_section, abs_tilt_neg_notify)
-    STATS_NAME(lsm6dsl_stat_section, free_fall_notify)
-    STATS_NAME(lsm6dsl_stat_section, sleep_notify)
-    STATS_NAME(lsm6dsl_stat_section, orientation_notify)
-    STATS_NAME(lsm6dsl_stat_section, wakeup_notify)
+STATS_NAME(lsm6dsl_stat_section, single_tap_notify)
+STATS_NAME(lsm6dsl_stat_section, double_tap_notify)
+STATS_NAME(lsm6dsl_stat_section, rel_tilt_notify)
+STATS_NAME(lsm6dsl_stat_section, abs_tilt_pos_notify)
+STATS_NAME(lsm6dsl_stat_section, abs_tilt_neg_notify)
+STATS_NAME(lsm6dsl_stat_section, free_fall_notify)

Review Comment:
   I would leave original indent as it was.
   I know that style check script complains, but in several instance before we simply ignored STATS_NAME no-indent suggestion because indented code seems more readable.
   So far no one made the effort to change style checker but most STATS_NAME are indented.



##########
hw/drivers/sensors/lsm6dsl/src/lsm6dsl_shell.c:
##########
@@ -167,11 +182,51 @@ lsm6dsl_shell_cmd_dump(int argc, char **argv)
             rc = lsm6dsl_read(g_lsm6dsl, reg_name[i].addr, &value, 1);
             if (rc) {
                 console_printf("dump failed %d\n", rc);
-            } else if (all || value != 0){
+            } else if (all || value != 0) {
                 console_printf("%-22s(0x%02X) = 0x%02X\n",
                                reg_name[i].regname, reg_name[i].addr, value);
             }
         }
+
+        /* Bank A */
+        rc = lsm6dsl_write_reg(g_lsm6dsl, LSM6DSL_FUNC_CFG_ACCESS_REG,
+                               LSM6DSL_FUNC_CFG_ACCESS_MASK);
+        if (rc) {
+            return rc;
+        }
+        for (i = 0; i < ARRAY_SIZE(reg_name_banka); i++) {
+            rc = lsm6dsl_read(g_lsm6dsl, reg_name_banka[i].addr, &value, 1);
+            if (rc) {
+                console_printf("dump failed %d\n", rc);
+            } else if (all || value != 0) {
+                console_printf("%-22s(0x%02X) = 0x%02X\n",
+                               reg_name_banka[i].regname, reg_name_banka[i].addr, value);
+            }
+        }
+        rc = lsm6dsl_write_reg(g_lsm6dsl, LSM6DSL_FUNC_CFG_ACCESS_REG, 0);
+        if (rc) {
+            return rc;
+        }
+
+        /* Bank B */
+        rc = lsm6dsl_write_reg(g_lsm6dsl, LSM6DSL_FUNC_CFG_ACCESS_REG,
+                               LSM6DSL_FUNC_CFG_ACCESS_MASK | LSM6DSL_SHUB_REG_ACCESS_MASK);
+        if (rc) {
+            return rc;
+        }
+        for (i = 0; i < ARRAY_SIZE(reg_name_bankb); i++) {
+            rc = lsm6dsl_read(g_lsm6dsl, reg_name_bankb[i].addr, &value, 1);
+            if (rc) {
+                console_printf("dump failed %d\n", rc);
+            } else if (all || value != 0) {
+                console_printf("%-22s(0x%02X) = 0x%02X\n",
+                               reg_name_bankb[i].regname, reg_name_bankb[i].addr, value);
+            }
+        }
+        rc = lsm6dsl_write_reg(g_lsm6dsl, LSM6DSL_FUNC_CFG_ACCESS_REG,0);

Review Comment:
   missing space after `,`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2849: sensors/lsm6dsl: add tilt function

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on PR #2849:
URL: https://github.com/apache/mynewt-core/pull/2849#issuecomment-1154392279

   
   <!-- style-bot -->
   
   ## Style check summary
   
   ### Our coding style is [here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
   #### hw/drivers/sensors/lsm6dsl/src/lsm6dsl_shell.c
   <details>
   
   ```diff
   @@ -198,7 +199,7 @@
                rc = lsm6dsl_read(g_lsm6dsl, reg_name_banka[i].addr, &value, 1);
                if (rc) {
                    console_printf("dump failed %d\n", rc);
   -            } else if (all || value != 0){
   +            } else if (all || value != 0) {
                    console_printf("%-22s(0x%02X) = 0x%02X\n",
                                   reg_name_banka[i].regname, reg_name_banka[i].addr, value);
                }
   @@ -209,7 +210,8 @@
            }
    
            /* Bank B */
   -        rc = lsm6dsl_write_reg(g_lsm6dsl, LSM6DSL_FUNC_CFG_ACCESS_REG, LSM6DSL_FUNC_CFG_ACCESS_MASK | LSM6DSL_SHUB_REG_ACCESS_MASK);
   +        rc = lsm6dsl_write_reg(g_lsm6dsl, LSM6DSL_FUNC_CFG_ACCESS_REG,
   +                               LSM6DSL_FUNC_CFG_ACCESS_MASK | LSM6DSL_SHUB_REG_ACCESS_MASK);
            if (rc) {
                return rc;
            }
   ```
   
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [mynewt-core] kasjer merged pull request #2849: sensors/lsm6dsl: add tilt function

Posted by GitBox <gi...@apache.org>.
kasjer merged PR #2849:
URL: https://github.com/apache/mynewt-core/pull/2849


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org