You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2021/03/04 08:16:19 UTC

[incubator-nuttx] branch master updated: stm32f7:lse Use Kconfig values directly

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 296d94b  stm32f7:lse Use Kconfig values directly
296d94b is described below

commit 296d94b5cbc6aa1e70fb0353ff902330bf3e4e7e
Author: David Sidrane <Da...@NscDg.com>
AuthorDate: Wed Mar 3 06:57:50 2021 -0800

    stm32f7:lse Use Kconfig values directly
---
 arch/arm/src/stm32f7/stm32_lse.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm/src/stm32f7/stm32_lse.c b/arch/arm/src/stm32f7/stm32_lse.c
index 3ed6a12..f91455c 100644
--- a/arch/arm/src/stm32f7/stm32_lse.c
+++ b/arch/arm/src/stm32f7/stm32_lse.c
@@ -69,6 +69,7 @@
  * Private Data
  ****************************************************************************/
 
+#ifdef CONFIG_STM32F7_RTC_AUTO_LSECLOCK_START_DRV_CAPABILITY
 static const uint32_t drives[4] =
 {
     RCC_BDCR_LSEDRV_LOW,
@@ -76,6 +77,7 @@ static const uint32_t drives[4] =
     RCC_BDCR_LSEDRV_MEDHI,
     RCC_BDCR_LSEDRV_HIGH
 };
+#endif
 
 /****************************************************************************
  * Public Functions
@@ -123,7 +125,8 @@ void stm32_rcc_enablelse(void)
        */
 
       regval &= ~(RCC_BDCR_LSEDRV_MASK);
-      regval |= drives[CONFIG_STM32F7_RTC_LSECLOCK_START_DRV_CAPABILITY];
+      regval |= CONFIG_STM32F7_RTC_LSECLOCK_START_DRV_CAPABILITY <<
+                RCC_BDCR_LSEDRV_SHIFT;
 #endif
 
 #ifdef CONFIG_STM32F7_RTC_AUTO_LSECLOCK_START_DRV_CAPABILITY
@@ -166,7 +169,8 @@ void stm32_rcc_enablelse(void)
       /* Set running drive capability for LSE oscillator. */
 
       regval &= ~RCC_BDCR_LSEDRV_MASK;
-      regval |= drives[CONFIG_STM32F7_RTC_LSECLOCK_RUN_DRV_CAPABILITY];
+      regval |= CONFIG_STM32F7_RTC_LSECLOCK_RUN_DRV_CAPABILITY <<
+                RCC_BDCR_LSEDRV_SHIFT;
       putreg32(regval, STM32_RCC_BDCR);
 #endif