stm32/sdcard: Properly reset SD periph when SDMMC2 is used on H7 MCUs.

This commit is contained in:
Damien George 2018-12-30 01:28:34 +11:00
parent c932639063
commit b33f108cde
1 changed files with 5 additions and 0 deletions

View File

@ -169,9 +169,14 @@ void HAL_SD_MspInit(SD_HandleTypeDef *hsd) {
#if defined(STM32H7)
// Reset SDMMC
#if defined(MICROPY_HW_SDMMC2_CK)
__HAL_RCC_SDMMC2_FORCE_RESET();
__HAL_RCC_SDMMC2_RELEASE_RESET();
#else
__HAL_RCC_SDMMC1_FORCE_RESET();
__HAL_RCC_SDMMC1_RELEASE_RESET();
#endif
#endif
// NVIC configuration for SDIO interrupts
NVIC_SetPriority(SDMMC_IRQn, IRQ_PRI_SDIO);