From e33b41abaabe7d2be2207c79d5ed59cb8ce7babc Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Mon, 12 Dec 2022 22:14:09 +0100 Subject: stm32g0: add stm32g0b0 support Signed-off-by: Alex Voinea --- src/stm32/stm32f0_timer.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/stm32/stm32f0_timer.c') diff --git a/src/stm32/stm32f0_timer.c b/src/stm32/stm32f0_timer.c index 4f5e6d38..0d8ed3a3 100644 --- a/src/stm32/stm32f0_timer.c +++ b/src/stm32/stm32f0_timer.c @@ -20,14 +20,17 @@ ****************************************************************/ // Use 32bit TIM2 timer if available (otherwise use 16bit TIM3 timer) -#ifdef TIM2 -#define TIMx TIM2 -#define TIMx_IRQn TIM2_IRQn -#define HAVE_TIMER_32BIT 1 -#else -#define TIMx TIM3 -#define TIMx_IRQn TIM3_IRQn -#define HAVE_TIMER_32BIT 0 +#if defined(TIM2) + #define TIMx TIM2 + #define TIMx_IRQn TIM2_IRQn + #define HAVE_TIMER_32BIT 1 +#elif defined(TIM3) + #define TIMx TIM3 + #define TIMx_IRQn TIM3_IRQn + #define HAVE_TIMER_32BIT 0 + #ifdef TIM4 + #define TIM3_IRQn TIM3_TIM4_IRQn + #endif #endif static inline uint32_t -- cgit v1.2.3-70-g09d2