mlaz commented on a change in pull request #2255: Add SGM4056 charger driver to 
pinetime BSP
URL: https://github.com/apache/mynewt-core/pull/2255#discussion_r401104381
 
 

 ##########
 File path: hw/drivers/chg_ctrl/sgm4056/src/sgm4056.c
 ##########
 @@ -0,0 +1,192 @@
+/*
+ * Copyright 2020 Casper Meijn <cas...@meijn.net>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "sgm4056/sgm4056.h"
+#include "hal/hal_gpio.h"
+
+#if MYNEWT_VAL(SGM4056_USE_CHARGE_CONTROL)
+
+static int 
+sgm4056_chg_ctrl_get_status(struct charge_control * chg_ctrl, int * status)
+{
+    struct sgm4056_dev *dev;
+    int rc;
+
+    dev = (struct sgm4056_dev *)CHARGE_CONTROL_GET_DEVICE(chg_ctrl);
+    if (dev == NULL) {
+        rc = SYS_ENODEV;
+        goto err;
+    }
+
+    rc = sgm4056_get_charger_status(dev, (charge_control_status_t *)status);
+
+err:
+    return rc;
+}
+
+static int 
+sgm4056_chg_ctrl_read(struct charge_control * chg_ctrl, 
+        charge_control_type_t type, charge_control_data_func_t data_func, 
+        void *data_arg, uint32_t timeout)
 
 Review comment:
   This indentation looks strange, I think it should start below `struct 
charge_control`, also same thing regarding the space between * and variable 
name.                                    

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to