aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.h')
-rw-r--r--os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.h42
1 files changed, 36 insertions, 6 deletions
diff --git a/os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.h b/os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.h
index e9e1a83c8..f1564c47d 100644
--- a/os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.h
+++ b/os/hal/ports/STM32/LLD/TIMv1/hal_st_lld.h
@@ -91,37 +91,67 @@
#if STM32_ST_USE_TIMER == 2
#if !STM32_HAS_TIM2
-#error "TIM2 not present"
+#error "TIM2 not present in the selected device"
+#endif
+#if defined(STM32_TIM2_IS_USED)
+#error "ST requires TIM2 but the timer is already used"
+#else
+#define STM32_TIM2_IS_USED
#endif
#define STM32_ST_TIM STM32_TIM2
#elif STM32_ST_USE_TIMER == 3
#if !STM32_HAS_TIM3
-#error "TIM3 not present"
+#error "TIM3 not present in the selected device"
+#endif
+#if defined(STM32_TIM3_IS_USED)
+#error "ST requires TIM3 but the timer is already used"
+#else
+#define STM32_TIM3_IS_USED
#endif
#define STM32_ST_TIM STM32_TIM3
#elif STM32_ST_USE_TIMER == 4
#if !STM32_HAS_TIM4
-#error "TIM4 not present"
+#error "TIM4 not present in the selected device"
+#endif
+#if defined(STM32_TIM4_IS_USED)
+#error "ST requires TIM4 but the timer is already used"
+#else
+#define STM32_TIM4_IS_USED
#endif
#define STM32_ST_TIM STM32_TIM4
#elif STM32_ST_USE_TIMER == 5
#if !STM32_HAS_TIM5
-#error "TIM5 not present"
+#error "TIM5 not present in the selected device"
+#endif
+#if defined(STM32_TIM5_IS_USED)
+#error "ST requires TIM5 but the timer is already used"
+#else
+#define STM32_TIM5_IS_USED
#endif
#define STM32_ST_TIM STM32_TIM5
#elif STM32_ST_USE_TIMER == 21
#if !STM32_HAS_TIM21
-#error "TIM21 not present"
+#error "TIM21 not present in the selected device"
+#endif
+#if defined(STM32_TIM21_IS_USED)
+#error "ST requires TIM21 but the timer is already used"
+#else
+#define STM32_TIM21_IS_USED
#endif
#define STM32_ST_TIM STM32_TIM21
#elif STM32_ST_USE_TIMER == 22
#if !STM32_HAS_TIM22
-#error "TIM22 not present"
+#error "TIM22 not present in the selected device"
+#endif
+#if defined(STM32_TIM22_IS_USED)
+#error "ST requires TIM22 but the timer is already used"
+#else
+#define STM32_TIM22_IS_USED
#endif
#define STM32_ST_TIM STM32_TIM22