[riot-notifications] [RIOT-OS/RIOT] sys/ztimer: add ZTIMER_SEC (#15715)

Marian Buschsieweke notifications at github.com
Thu Jan 7 12:31:38 CET 2021


@maribu commented on this pull request.



> @@ -98,6 +100,27 @@ ztimer_clock_t *const ZTIMER_MSEC_BASE = &_ztimer_periph_timer_usec.super;
 #  endif
 #endif
 
+#if MODULE_ZTIMER_SEC
+#  if MODULE_ZTIMER_PERIPH_RTC
+static ztimer_periph_rtc_t _ztimer_periph_timer_rtc_sec;
+ztimer_clock_t *const ZTIMER_SEC = &_ztimer_periph_timer_rtc_sec;
+#  elif MODULE_ZTIMER_MSEC
+static ztimer_convert_frac_t _ztimer_convert_frac_sec;
+ztimer_clock_t *const ZTIMER_SEC = &_ztimer_convert_frac_sec.super.super;
+ztimer_clock_t *const ZTIMER_SEC_BASE = &_ztimer_periph_timer_msec.super;
+#    define ZTIMER_SEC_CONVERT_LOWER        (&_ztimer_periph_timer_rtt_msec)

Good catch. I changed the preprocessor conditional to only uses this if both `ztimer_msec` and `ztimer_periph_rtt` are used.

Maybe it makes sense to decouple this from `ztimer_msec` to also profit from the power savings when `ztimer_sec` but not `ztimer_msec` is used. I'll fix this.

-- 
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/15715#discussion_r553272731
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210107/a9dac976/attachment-0001.htm>


More information about the notifications mailing list