aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/TIMv1/st_lld.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/ports/STM32/TIMv1/st_lld.c')
-rw-r--r--os/hal/ports/STM32/TIMv1/st_lld.c48
1 files changed, 30 insertions, 18 deletions
diff --git a/os/hal/ports/STM32/TIMv1/st_lld.c b/os/hal/ports/STM32/TIMv1/st_lld.c
index a8b858e8c..7858e1fd8 100644
--- a/os/hal/ports/STM32/TIMv1/st_lld.c
+++ b/os/hal/ports/STM32/TIMv1/st_lld.c
@@ -35,37 +35,49 @@
#if (OSAL_ST_RESOLUTION == 32) && !STM32_TIM2_IS_32BITS
#error "TIM2 is not a 32bits timer"
#endif
+#if (OSAL_ST_RESOLUTION == 16) && STM32_TIM2_IS_32BITS
+#error "TIM2 is not a 16bits timer"
+#endif
#define ST_HANDLER STM32_TIM2_HANDLER
#define ST_NUMBER STM32_TIM2_NUMBER
#define ST_ENABLE_CLOCK() rccEnableTIM2(FALSE)
-#elif STM32_ST_USE_TIMER == 5
-#if (OSAL_ST_RESOLUTION == 32) && !STM32_TIM5_IS_32BITS
-#error "TIM5 is not a 32bits timer"
+#elif STM32_ST_USE_TIMER == 3
+#if (OSAL_ST_RESOLUTION == 32) && !STM32_TIM3_IS_32BITS
+#error "TIM3 is not a 32bits timer"
+#endif
+#if (OSAL_ST_RESOLUTION == 16) && STM32_TIM3_IS_32BITS
+#error "TIM3 is not a 16bits timer"
#endif
-#define ST_HANDLER STM32_TIM5_HANDLER
-#define ST_NUMBER STM32_TIM5_NUMBER
-#define ST_ENABLE_CLOCK() rccEnableTIM5(FALSE)
+#define ST_HANDLER STM32_TIM3_HANDLER
+#define ST_NUMBER STM32_TIM3_NUMBER
+#define ST_ENABLE_CLOCK() rccEnableTIM3(FALSE)
-#elif STM32_ST_USE_TIMER == 6
-#if (OSAL_ST_RESOLUTION == 32) && !STM32_TIM6_IS_32BITS
-#error "TIM6 is not a 32bits timer"
+#elif STM32_ST_USE_TIMER == 4
+#if (OSAL_ST_RESOLUTION == 32) && !STM32_TIM4_IS_32BITS
+#error "TIM4 is not a 32bits timer"
+#endif
+#if (OSAL_ST_RESOLUTION == 16) && STM32_TIM4_IS_32BITS
+#error "TIM4 is not a 16bits timer"
#endif
-#define ST_HANDLER STM32_TIM6_HANDLER
-#define ST_NUMBER STM32_TIM6_NUMBER
-#define ST_ENABLE_CLOCK() rccEnableTIM6(FALSE)
+#define ST_HANDLER STM32_TIM4_HANDLER
+#define ST_NUMBER STM32_TIM4_NUMBER
+#define ST_ENABLE_CLOCK() rccEnableTIM4(FALSE)
-#elif STM32_ST_USE_TIMER == 7
-#if (OSAL_ST_RESOLUTION == 32) && !STM32_TIM7_IS_32BITS
-#error "TIM7 is not a 32bits timer"
+#elif STM32_ST_USE_TIMER == 5
+#if (OSAL_ST_RESOLUTION == 32) && !STM32_TIM5_IS_32BITS
+#error "TIM5 is not a 32bits timer"
+#endif
+#if (OSAL_ST_RESOLUTION == 16) && STM32_TIM5_IS_32BITS
+#error "TIM5 is not a 16bits timer"
#endif
-#define ST_HANDLER STM32_TIM7_HANDLER
-#define ST_NUMBER STM32_TIM7_NUMBER
-#define ST_ENABLE_CLOCK() rccEnableTIM7(FALSE)
+#define ST_HANDLER STM32_TIM5_HANDLER
+#define ST_NUMBER STM32_TIM5_NUMBER
+#define ST_ENABLE_CLOCK() rccEnableTIM5(FALSE)
#else
#error "STM32_ST_USE_TIMER specifies an unsupported timer"