From 6057078834a962099e08219d60248d5fe40a7431 Mon Sep 17 00:00:00 2001 From: Karl Fessel Date: Tue, 19 Jul 2022 17:10:57 +0200 Subject: [PATCH] example adding lptimer to stm32 and using it there is no real secondary lptimer on stm32 therefor timer3 is used --- boards/common/stm32/include/cfg_timer_tim2.h | 10 +++++++++- tests/ztimer_xsec/Makefile | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/boards/common/stm32/include/cfg_timer_tim2.h b/boards/common/stm32/include/cfg_timer_tim2.h index d7f6008c6ffcb..25f5421b40d03 100644 --- a/boards/common/stm32/include/cfg_timer_tim2.h +++ b/boards/common/stm32/include/cfg_timer_tim2.h @@ -47,10 +47,18 @@ static const timer_conf_t timer_config[] = { #endif .bus = APB1, .irqn = TIM2_IRQn - } + }, + { + .dev = TIM3, + .max = 0xffffffff, + .rcc_mask = RCC_APB1ENR_TIM3EN, + .bus = APB1, + .irqn = TIM3_IRQn + }, }; #define TIMER_0_ISR isr_tim2 +#define TIMER_1_ISR isr_tim3 #define TIMER_NUMOF ARRAY_SIZE(timer_config) /** @} */ diff --git a/tests/ztimer_xsec/Makefile b/tests/ztimer_xsec/Makefile index baa0f6980e914..bbffc52b902d8 100644 --- a/tests/ztimer_xsec/Makefile +++ b/tests/ztimer_xsec/Makefile @@ -4,5 +4,8 @@ USEMODULE += ztimer USEMODULE += ztimer_usec USEMODULE += ztimer_msec USEMODULE += ztimer_sec +USEMODULE += ztimer_periph_lptimer + +CFLAGS += "-DCONFIG_ZTIMER_LPTIMER_DEV=TIMER_DEV(1)" "-DCONFIG_ZTIMER_LPTIMER_FREQ=1000LU" "-DCONFIG_ZTIMER_LPTIMER_WIDTH=32" "-DCONFIG_ZTIMER_LPTIMER_BLOCK_PM_MODE=ZTIMER_CLOCK_NO_REQUIRED_PM_MODE" include $(RIOTBASE)/Makefile.include