diff --git a/arch/arm/src/stm32/stm32_pwm.c b/arch/arm/src/stm32/stm32_pwm.c index 1a4d224257..6885b91434 100644 --- a/arch/arm/src/stm32/stm32_pwm.c +++ b/arch/arm/src/stm32/stm32_pwm.c @@ -84,20 +84,21 @@ #define TIMTYPE_ADVANCED 4 /* Advanced timers: TIM1-8 */ #define TIMTYPE_TIM1 TIMTYPE_ADVANCED -#ifdef CONFIG_STM32_STM32L15XX +#if defined(CONFIG_STM32_STM32L15XX) || defined(CONFIG_STM32_STM32F10XX) # define TIMTYPE_TIM2 TIMTYPE_GENERAL16 -# define TIMTYPE_TIM3 TIMTYPE_GENERAL16 -# define TIMTYPE_TIM4 TIMTYPE_GENERAL16 -# define TIMTYPE_TIM5 TIMTYPE_GENERAL32 -#elif defined(CONFIG_STM32_STM32F10XX) -# define TIMTYPE_TIM2 TIMTYPE_GENERAL16 -# define TIMTYPE_TIM3 TIMTYPE_GENERAL16 -# define TIMTYPE_TIM4 TIMTYPE_GENERAL16 -# define TIMTYPE_TIM5 TIMTYPE_GENERAL16 #else # define TIMTYPE_TIM2 TIMTYPE_GENERAL32 +#endif +#if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) # define TIMTYPE_TIM3 TIMTYPE_GENERAL32 # define TIMTYPE_TIM4 TIMTYPE_GENERAL32 +#else +# define TIMTYPE_TIM3 TIMTYPE_GENERAL16 +# define TIMTYPE_TIM4 TIMTYPE_GENERAL16 +#endif +#if defined(CONFIG_STM32_STM32F10XX) || defined(CONFIG_STM32_STM32F30XX) +# define TIMTYPE_TIM5 TIMTYPE_GENERAL16 +#else # define TIMTYPE_TIM5 TIMTYPE_GENERAL32 #endif #define TIMTYPE_TIM6 TIMTYPE_BASIC