Skip to content

Commit

Permalink
example adding lptimer to stm32 and using it
Browse files Browse the repository at this point in the history
there is no real secondary lptimer on stm32 therefor timer3 is used
  • Loading branch information
kfessel committed Jul 19, 2022
1 parent b75433a commit 6057078
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 9 additions & 1 deletion boards/common/stm32/include/cfg_timer_tim2.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
/** @} */
Expand Down
3 changes: 3 additions & 0 deletions tests/ztimer_xsec/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 6057078

Please sign in to comment.