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

pull/4395/head
Damien George 2018-12-30 01:28:34 +11:00
rodzic c932639063
commit b33f108cde
1 zmienionych plików z 5 dodań i 0 usunięć

Wyświetl plik

@ -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);