This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch releases/12.10
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/releases/12.10 by this push:
new 6e2ef4c0aa arch/stm32f0l0g0/stm32_tim.c: fix compilation when
TIM6/TIM7 is missing
6e2ef4c0aa is described below
commit 6e2ef4c0aa3dd4cf45f63f9e46f52709e1e75858
Author: raiden00pl <[email protected]>
AuthorDate: Wed Jun 11 14:43:19 2025 +0200
arch/stm32f0l0g0/stm32_tim.c: fix compilation when TIM6/TIM7 is missing
Fix compilation when TIM6/TIM7 is missing for stm32-m0.
Signed-off-by: raiden00pl <[email protected]>
---
arch/arm/src/stm32f0l0g0/stm32_tim.c | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
diff --git a/arch/arm/src/stm32f0l0g0/stm32_tim.c
b/arch/arm/src/stm32f0l0g0/stm32_tim.c
index 4b79d565f9..eeaf5eb3cc 100644
--- a/arch/arm/src/stm32f0l0g0/stm32_tim.c
+++ b/arch/arm/src/stm32f0l0g0/stm32_tim.c
@@ -897,11 +897,19 @@ static int stm32_tim_setmode(struct stm32_tim_dev_s *dev,
* disable it, simply set its clock to valid frequency or zero.
*/
- if (((struct stm32_tim_priv_s *)dev)->base == STM32_TIM6_BASE || \
- ((struct stm32_tim_priv_s *)dev)->base == STM32_TIM7_BASE)
+#ifdef STM32_TIM6_BASE
+ if (((struct stm32_tim_priv_s *)dev)->base == STM32_TIM6_BASE)
{
return -EINVAL;
}
+#endif
+
+#ifdef STM32_TIM7_BASE
+ if (((struct stm32_tim_priv_s *)dev)->base == STM32_TIM7_BASE)
+ {
+ return -EINVAL;
+ }
+#endif
/* Decode operational modes */
@@ -985,11 +993,19 @@ static int stm32_tim_setchannel(struct stm32_tim_dev_s
*dev,
* disable it, simply set its clock to valid frequency or zero.
*/
- if (((struct stm32_tim_priv_s *)dev)->base == STM32_TIM6_BASE || \
- ((struct stm32_tim_priv_s *)dev)->base == STM32_TIM7_BASE)
+#ifdef STM32_TIM6_BASE
+ if (((struct stm32_tim_priv_s *)dev)->base == STM32_TIM6_BASE)
{
return -EINVAL;
}
+#endif
+
+#ifdef STM32_TIM7_BASE
+ if (((struct stm32_tim_priv_s *)dev)->base == STM32_TIM7_BASE)
+ {
+ return -EINVAL;
+ }
+#endif
/* Decode configuration */