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/12/03 08:32:29 UTC

[GitHub] kasjer commented on a change in pull request #1524: hw/drivers: Add bus driver support to some of existing drivers

kasjer commented on a change in pull request #1524: hw/drivers: Add bus driver support to some of existing drivers
URL: https://github.com/apache/mynewt-core/pull/1524#discussion_r238171212
 
 

 ##########
 File path: hw/drivers/chg_ctrl/adp5061/src/adp5061.c
 ##########
 @@ -251,20 +264,25 @@ int
 adp5061_set_regs(struct adp5061_dev *dev, uint8_t addr,
         const uint8_t *values, int count)
 {
-    int rc = 0;
-    int i;
     uint8_t payload[1 + count];
-    struct hal_i2c_master_data data_struct = {
-        .address = dev->a_chg_ctrl.cc_itf.cci_addr,
-        .len = count + 1,
-        .buffer = payload
-    };
+    int i;
+    int rc;
 
     payload[0] = addr;
     for (i = 0; i < count; ++i) {
         payload[i + 1] = values[i];
     }
 
+#if MYNEWT_VAL(BUS_DRIVER_PRESENT)
+    rc = bus_node_simple_write((struct os_dev *)&dev->a_node, payload, count + 1);
+#else
+    int i;
 
 Review comment:
   redeclaration of i

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