Merged in Justifa/nuttx (pull request #855)

Master

* arch/arm/src/stm32l4/stm32l4_pwm.c Fix register addr, en_bit and resetbit for pwm timers

* configs/nucleo-l476rg/src/nucleo-l476rg.h Fixed naming stm32l4_pwm_setup
    configs/nucleo-l476rg/src/stm32_appinit.c Fixed naming stm32l4_pwm_setup

Approved-by: David Sidrane <david_s5@nscdg.com>
Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
Fabian Justi
2019-04-17 13:48:37 +00:00
committed by Gregory Nutt
parent dd1a2b5ddb
commit 53a94594d6
3 changed files with 14 additions and 14 deletions
+12 -12
View File
@@ -1623,25 +1623,25 @@ static void stm32l4pwm_setapbclock(FAR struct stm32l4_pwmtimer_s *priv, bool on)
#endif
#ifdef CONFIG_STM32L4_TIM2_PWM
case 2:
regaddr = STM32L4_RCC_APB1ENR;
en_bit = RCC_APB1ENR_TIM2EN;
regaddr = STM32L4_RCC_APB1ENR1;
en_bit = RCC_APB1ENR1_TIM2EN;
break;
#endif
#ifdef CONFIG_STM32L4_TIM3_PWM
case 3:
regaddr = STM32L4_RCC_APB1ENR;
regaddr = STM32L4_RCC_APB1ENR1;
en_bit = RCC_APB1ENR_TIM3EN;
break;
#endif
#ifdef CONFIG_STM32L4_TIM4_PWM
case 4:
regaddr = STM32L4_RCC_APB1ENR;
en_bit = RCC_APB1ENR_TIM4EN;
regaddr = STM32L4_RCC_APB1ENR1;
en_bit = RCC_APB1ENR1_TIM4EN;
break;
#endif
#ifdef CONFIG_STM32L4_TIM5_PWM
case 5:
regaddr = STM32L4_RCC_APB1ENR;
regaddr = STM32L4_RCC_APB1ENR1;
en_bit = RCC_APB1ENR_TIM5EN;
break;
#endif
@@ -1953,25 +1953,25 @@ static int stm32l4pwm_stop(FAR struct pwm_lowerhalf_s *dev)
#endif
#ifdef CONFIG_STM32L4_TIM2_PWM
case 2:
regaddr = STM32L4_RCC_APB1RSTR;
resetbit = RCC_APB1RSTR_TIM2RST;
regaddr = STM32L4_RCC_APB1RSTR1;
resetbit = RCC_APB1RSTR1_TIM2RST;
break;
#endif
#ifdef CONFIG_STM32L4_TIM3_PWM
case 3:
regaddr = STM32L4_RCC_APB1RSTR;
regaddr = STM32L4_RCC_APB1RSTR1;
resetbit = RCC_APB1RSTR_TIM3RST;
break;
#endif
#ifdef CONFIG_STM32L4_TIM4_PWM
case 4:
regaddr = STM32L4_RCC_APB1RSTR;
resetbit = RCC_APB1RSTR_TIM4RST;
regaddr = STM32L4_RCC_APB1RSTR1;
resetbit = RCC_APB1RSTR1_TIM4RST;
break;
#endif
#ifdef CONFIG_STM32L4_TIM5_PWM
case 5:
regaddr = STM32L4_RCC_APB1RSTR;
regaddr = STM32L4_RCC_APB1RSTR1;
resetbit = RCC_APB1RSTR_TIM5RST;
break;
#endif
+1 -1
View File
@@ -346,7 +346,7 @@ int stm32l4_can_setup(void);
************************************************************************************/
#ifdef CONFIG_PWM
int stm32l4_pwm_setup(void);
int stm32_pwm_setup(void);
#endif
/************************************************************************************
+1 -1
View File
@@ -193,7 +193,7 @@ int board_app_initialize(uintptr_t arg)
#ifdef CONFIG_PWM
/* Initialize PWM and register the PWM device. */
ret = stm32l4_pwm_setup();
ret = stm32_pwm_setup();
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: stm32l4_pwm_setup() failed: %d\n", ret);