fix but in pwr module where the parameters to getreg32 were reversed; didn't do much useful that way!

This commit is contained in:
ziggurat29 2016-03-28 20:44:20 -05:00
parent 5bd7b7b54c
commit 72f4f1c9ea
2 changed files with 5 additions and 3 deletions

View File

@ -89,7 +89,7 @@ void stm32l4_rcc_enablelse(void)
*/
regval = getreg32(STM32L4_RCC_BDCR);
regval |= RCC_BDCR_LSEON|RCC_BDCR_LSEDRV_MIDHI;
regval |= RCC_BDCR_LSEON;
putreg32(regval,STM32L4_RCC_BDCR);
/* Wait for the LSE clock to be ready */

View File

@ -111,14 +111,16 @@ bool stm32l4_pwr_enableclk(bool enable)
/* Disable power interface clock */
regval &= ~RCC_APB1ENR1_PWREN;
putreg32(STM32L4_RCC_APB1ENR1, regval);
putreg32(regval, STM32L4_RCC_APB1ENR1);
regval = getreg32(STM32L4_RCC_APB1ENR1);
}
else if (!wasenabled && enable)
{
/* Enable power interface clock */
regval |= RCC_APB1ENR1_PWREN;
putreg32(STM32L4_RCC_APB1ENR1, regval);
putreg32(regval, STM32L4_RCC_APB1ENR1);
regval = getreg32(STM32L4_RCC_APB1ENR1);
}
return wasenabled;