Skip to content

Commit

Permalink
Revert "Fix #73: Enable HAL_RCC_PWR_CLK, PWR_LOWPOWERREGULATOR_ON, PW…
Browse files Browse the repository at this point in the history
…R_CR_ULP"

This reverts commit 9e5d3b7. See
Terry's comments in #76 review for why. It needs reconsideration.
  • Loading branch information
terrillmoore committed Apr 14, 2019
1 parent c6ec217 commit 1a4466e
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions system/Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_pwr.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ static void HAL_PWR_RestoreCFGR(uint32_t save_rcc_cfgr)
{
/* Wait for PLL ready */
}

RCC->CFGR = save_rcc_cfgr;

while (LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL)
Expand Down Expand Up @@ -639,18 +639,6 @@ void HAL_PWR_EnterSTANDBYMode(void)
uint32_t const save_rcc_cfgr = RCC->CFGR;
uint32_t const save_pwr_cr = PWR->CR;

/* Enable Power interface clock */
__HAL_RCC_PWR_CLK_ENABLE();

/* Enable the low power voltage regulator */
SET_BIT(PWR->CR, PWR_LOWPOWERREGULATOR_ON);

/* Set Ultra-Low-power mode by switch-off Vrefint */
SET_BIT(PWR->CR, PWR_CR_ULP);

/* Clear WUF flag */
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);

/* Select Standby mode */
SET_BIT(PWR->CR, PWR_CR_PDDS);

Expand All @@ -676,9 +664,6 @@ void HAL_PWR_EnterSTANDBYMode(void)
/* restore the register we stuffed */
PWR->CR = save_pwr_cr;
HAL_PWR_RestoreCFGR(save_rcc_cfgr);

/* Disable Power interface clock */
__HAL_RCC_PWR_CLK_DISABLE();
}

/**
Expand Down

0 comments on commit 1a4466e

Please sign in to comment.