mirror of
https://github.com/apache/nuttx.git
synced 2026-05-24 07:46:16 +08:00
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 <raiden00@railab.me>
This commit is contained in:
@@ -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 */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user