[riot-notifications] [RIOT-OS/RIOT] drivers/ltc4150: (Re-)implemented driver for the LTC4150 coulomb counter (#10755)

Sebastian Meiling notifications at github.com
Wed Jan 16 11:47:10 CET 2019


smlng commented on this pull request.



> +        for (unsigned i = 0; dev->params.recorders[i] != NULL; i++) {
+            dev->params.recorders[i]->pulse(dev, dir, now,
+                                            dev->params.recorder_data[i]);
+        }
+    }
+
+    dev->last_update_sec = now / US_PER_SEC;
+}
+
+int ltc4150_init(ltc4150_dev_t *dev, const ltc4150_params_t *params)
+{
+    if (!dev || !params) {
+        return -EINVAL;
+    }
+
+    memset(dev, 0x00, sizeof(ltc4150_dev_t));

yep, true that ... leave as is.

However, please be consistent and style/usage, i.e. here you write `memset(..., 0x00 ...)` and below `memset(..., 0, ...)` ... I think the latter is nicer.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10755#discussion_r248233086
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190116/d070567f/attachment-0001.html>


More information about the notifications mailing list