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

Francisco notifications at github.com
Thu Jun 3 18:03:16 CEST 2021


@fjmolinas 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++) {

Sorry that was the wrong suggestion (a petty one from my side), I see two options:

- add a dependency to `ztimer` for the driver
- add a generic `cpu_core_frequency` or `cpu_freqeuncy`, inlined to `CLOCK_CORECLOCK` unless a `HAD_CPU_FREQUENCY` flag is set. Now where could such definition be plassed?

-- 
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_r644924525
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210603/91b5272a/attachment-0001.htm>


More information about the notifications mailing list