[riot-notifications] [RIOT-OS/RIOT] sys/ztimer: initial import (#11874)

Marian Buschsieweke notifications at github.com
Tue Sep 10 10:00:08 CEST 2019


maribu commented on this pull request.

OK. The general architecture and the user facing API are fine. It adds no more complexity than required to allow different timer bases, and the advantages of this are obvious and outweigh the cost of one additional parameter by means.

Having the proposed plan in mind to bring this to master, so that it can be tested and gradually improved to the point it can replace `xtimer`, I'd say this PR is generally in the shape to get merged. (One exception: The TODO in the user facing API, I added the comment in the reminder. The function should also be documented properly.)

> + * @param[in]   last_wakeup     base time stamp for the wakeup
+ * @param[in]   period          time in ticks that will be added to @p last_wakeup
+ */
+void ztimer_periodic_wakeup(ztimer_dev_t *ztimer, uint32_t *last_wakeup,
+                            uint32_t period);
+
+/**
+ * @brief   Put the calling thread to sleep for the specified number of ticks
+ *
+ * @param[in]   ztimer          ztimer clock to use
+ * @param[in]   duration        duration of sleep, in @p ztimer time units
+ */
+void ztimer_sleep(ztimer_dev_t *ztimer, uint32_t duration);
+
+/* TODO is this overhead calibration?? */
+uint32_t ztimer_diff(ztimer_dev_t *ztimer, uint32_t base);

Reminder ;-)

-- 
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/11874#pullrequestreview-285964689
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190910/cc4f979d/attachment-0001.htm>


More information about the notifications mailing list