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

Alexandre Abadie notifications at github.com
Mon May 31 12:27:32 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++) {

But still, in some (rare) cases, CLOCK_CORECLOCK might not be defined, so this won't build in the case where ztimer is not used.

-- 
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#pullrequestreview-672178841
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210531/cf637656/attachment.htm>


More information about the notifications mailing list