aboutsummaryrefslogtreecommitdiffstats
path: root/src/stm32/stm32f0_timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stm32/stm32f0_timer.c')
-rw-r--r--src/stm32/stm32f0_timer.c19
1 files changed, 11 insertions, 8 deletions
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