-
Notifications
You must be signed in to change notification settings - Fork 2.1k
ztimer with two instances of ztimer_periph_timer #17611
Description
Description
I'm using ztimer on the efm32 family. This family has two different types of periph_timer: One which makes use of the EFM32 TIMER peripheral and one that utilizes the EFM32 LETIMER peripheral. The latter one may be clocked by a low-frequency crystal and stays active during lower power modes.
I'd like to use a LETIMER for the ZTIMER_MSEC and one TIMER for the ZTIMER_USEC. This combination isn't supported by ztimer_init. (I have reasons for not using periph_rtt: it conflicts with the internal radio in my case.) I see two different options for this:
- Make
ztimer_init()weak and provide an ownztimer_init()for the EFM32 family. - Somehow bring this combination into the current
ztimer_init()
I'd say the first option is the better one. The current ztimer_init() implementation is already very complex. I'd say introducing more complexity for this corner case isn't worth it.
What do you think?
Useful links
periph_timerimplementation for the EFM32 familyperiph_conf.hof theikea-tradfriboard that would benefit from this patch.