Skip to content

Commit

Permalink
perf: optimize flash usage of SD card driver by limiting the clock se…
Browse files Browse the repository at this point in the history
…ttings to HSI48
  • Loading branch information
TychoVrahe committed Dec 4, 2023
1 parent f1946d6 commit 270974e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Src/stm32u5xx_hal_sd.c
Expand Up @@ -476,7 +476,7 @@ HAL_StatusTypeDef HAL_SD_InitCard(SD_HandleTypeDef *hsd)
Init.HardwareFlowControl = SDMMC_HARDWARE_FLOW_CONTROL_DISABLE;

/* Init Clock should be less or equal to 400Khz*/
sdmmc_clk = HAL_RCCEx_GetPeriphCLKFreq(RCC_PERIPHCLK_SDMMC);
sdmmc_clk = HSI48_VALUE;
if (sdmmc_clk == 0U)
{
hsd->State = HAL_SD_STATE_READY;
Expand Down Expand Up @@ -2408,7 +2408,7 @@ HAL_StatusTypeDef HAL_SD_ConfigWideBusOperation(SD_HandleTypeDef *hsd, uint32_t
}
else
{
sdmmc_clk = HAL_RCCEx_GetPeriphCLKFreq(RCC_PERIPHCLK_SDMMC);
sdmmc_clk = HSI48_VALUE;
if (sdmmc_clk != 0U)
{
/* Configure the SDMMC peripheral */
Expand Down

0 comments on commit 270974e

Please sign in to comment.