Skip to content

Commit

Permalink
Keep HSI16 working in stop mode. (flipperdevices#2621)
Browse files Browse the repository at this point in the history
  • Loading branch information
skotopes authored Apr 27, 2023
1 parent 0ec8fc4 commit 408edb3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion firmware/targets/f7/furi_hal/furi_hal_clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
;
Expand Down
1 change: 1 addition & 0 deletions firmware/targets/f7/furi_hal/furi_hal_power.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 408edb3

Please sign in to comment.