Merge pull request #3311 from xiangxistu/master
[bsp][stm32] fixed a bug that caused system crash by changing the run_mode in low power mode
This commit is contained in:
commit
6765cf7943
|
@ -95,11 +95,13 @@ static void run(struct rt_pm *pm, uint8_t mode)
|
||||||
{
|
{
|
||||||
case PM_RUN_MODE_HIGH_SPEED:
|
case PM_RUN_MODE_HIGH_SPEED:
|
||||||
case PM_RUN_MODE_NORMAL_SPEED:
|
case PM_RUN_MODE_NORMAL_SPEED:
|
||||||
|
HAL_PWREx_DisableLowPowerRunMode();
|
||||||
SystemClock_80M();
|
SystemClock_80M();
|
||||||
/* Configure the main internal regulator output voltage (Range1 by default)*/
|
/* Configure the main internal regulator output voltage (Range1 by default)*/
|
||||||
HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1);
|
HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1);
|
||||||
break;
|
break;
|
||||||
case PM_RUN_MODE_MEDIUM_SPEED:
|
case PM_RUN_MODE_MEDIUM_SPEED:
|
||||||
|
HAL_PWREx_DisableLowPowerRunMode();
|
||||||
SystemClock_24M();
|
SystemClock_24M();
|
||||||
/* Configure the main internal regulator output voltage */
|
/* Configure the main internal regulator output voltage */
|
||||||
HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE2);
|
HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE2);
|
||||||
|
|
Loading…
Reference in New Issue