Keep HSI16 working in stop mode. (#2621)

This commit is contained in:
あく 2023-04-27 23:01:13 +09:00 committed by GitHub
parent 0ec8fc4c55
commit 408edb3e99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -144,6 +144,7 @@ void furi_hal_clock_init() {
LL_RCC_SetRNGClockSource(LL_RCC_RNG_CLKSOURCE_CLK48);
LL_RCC_SetUSBClockSource(LL_RCC_USB_CLKSOURCE_PLLSAI1);
LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_PLLSAI1);
LL_RCC_HSI_EnableInStopMode(); // Ensure that MR is capable of work in STOP0
LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSE);
LL_RCC_SetSMPSPrescaler(LL_RCC_SMPS_DIV_1);
LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
@ -207,8 +208,8 @@ void furi_hal_clock_switch_to_hsi() {
while(!LL_RCC_HSI_IsReady())
;
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_HSI);
LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_HSI);
while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_HSI)
;

View file

@ -94,6 +94,7 @@ void furi_hal_power_init() {
LL_PWR_SetRegulVoltageScaling(LL_PWR_REGU_VOLTAGE_SCALE1);
LL_PWR_SMPS_SetMode(LL_PWR_SMPS_STEP_DOWN);
LL_PWR_SetPowerMode(FURI_HAL_POWER_STOP_MODE);
LL_C2_PWR_SetPowerMode(FURI_HAL_POWER_STOP_MODE);