From f1d5e98c819d9cfc113da034dee040026f834899 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Wed, 12 Aug 2020 14:42:36 +0200 Subject: [PATCH] sys/ztimer: fix ztimer msec convert for 250kHz timers --- sys/ztimer/auto_init.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sys/ztimer/auto_init.c b/sys/ztimer/auto_init.c index a3953cd7ac..489b86ac93 100644 --- a/sys/ztimer/auto_init.c +++ b/sys/ztimer/auto_init.c @@ -68,7 +68,6 @@ ztimer_clock_t *const ZTIMER_USEC = &_ztimer_convert_shift_usec.super.super; # else static ztimer_convert_frac_t _ztimer_convert_frac_usec; ztimer_clock_t *const ZTIMER_USEC = &_ztimer_convert_frac_usec.super.super; -# define ZTIMER_USEC_CONVERT_LOWER (&_ztimer_periph_timer_usec.super) # endif # else # error ztimer_usec selected, but no configuration available! @@ -92,13 +91,8 @@ ztimer_clock_t *const ZTIMER_MSEC = &_ztimer_periph_timer_rtt_msec; static ztimer_convert_frac_t _ztimer_convert_frac_msec; ztimer_clock_t *const ZTIMER_MSEC = &_ztimer_convert_frac_msec.super.super; ztimer_clock_t *const ZTIMER_MSEC_BASE = &_ztimer_periph_timer_usec.super; -# if CONFIG_ZTIMER_USEC_BASE_FREQ < FREQ_1MHZ -# define ZTIMER_MSEC_CONVERT_LOWER ZTIMER_USEC_CONVERT_LOWER -# define ZTIMER_MSEC_CONVERT_LOWER_FREQ CONFIG_ZTIMER_USEC_BASE_FREQ -# else -# define ZTIMER_MSEC_CONVERT_LOWER (ZTIMER_USEC) -# define ZTIMER_MSEC_CONVERT_LOWER_FREQ FREQ_1MHZ -# endif +# define ZTIMER_MSEC_CONVERT_LOWER ZTIMER_USEC_BASE +# define ZTIMER_MSEC_CONVERT_LOWER_FREQ CONFIG_ZTIMER_USEC_BASE_FREQ # else # error No suitable ZTIMER_MSEC config. Maybe add USEMODULE += ztimer_usec? # endif