diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-09-12 13:57:51 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-09-12 13:57:51 +0000 |
commit | e525eb795a7a27dc7778f399a6df68ac1ab48a97 (patch) | |
tree | 32781f328468a1343ad6b3514c48bd5a17c7b78a /os/hal/ports/STM32/TIMv1/st_lld.c | |
parent | 232ae706e91fb0113591dab7116965c7c2b09351 (diff) | |
download | ChibiOS-e525eb795a7a27dc7778f399a6df68ac1ab48a97.tar.gz ChibiOS-e525eb795a7a27dc7778f399a6df68ac1ab48a97.tar.bz2 ChibiOS-e525eb795a7a27dc7778f399a6df68ac1ab48a97.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6296 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/ports/STM32/TIMv1/st_lld.c')
-rw-r--r-- | os/hal/ports/STM32/TIMv1/st_lld.c | 48 |
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"
|