[riot-notifications] [RIOT-OS/RIOT] drivers/hm3301: initial commit (#16333)

Alexandre Abadie notifications at github.com
Tue Jun 1 10:44:24 CEST 2021


@aabadie commented on this pull request.



> +        .nc_pm_5    = (buf[24] << 8) | buf[25],
+        .nc_pm_10   = (buf[26] << 8) | buf[27],
+    };
+    memcpy(data, &tmp, sizeof(hm3301_data_t));
+
+    return 0;
+}
+
+void hm3301_reset(hm3301_t *dev)
+{
+    if (gpio_is_valid(dev->params.reset_pin)) {
+        gpio_clear(dev->params.reset_pin);
+#if IS_USED(MODULE_ZTIMER_USEC)
+        ztimer_sleep(ZTIMER_USEC, HM3301_RESET_TIME_US);
+#else
+        for (uint32_t i = 0; i < HM3301_RESET_TIME_US * (CLOCK_CORECLOCK / US_PER_SEC) ; i++) {

> Currently, it's defined for all platforms

Not on fe310 if HFROSC clock source is used (as explained in https://github.com/RIOT-OS/RIOT/pull/16333#discussion_r642039592). Have you read this comment ? (especially the end where I talk about a static inline function)

-- 
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/16333#discussion_r642904393
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210601/2644536c/attachment.htm>


More information about the notifications mailing list