STM32H7 - Fix SDIO initialisation caused by USE_DMA_SPEC changes.
H7 uses IDMA, no DMA channel spec needed.
This commit is contained in:
parent
3acaf16090
commit
fe797aa633
|
@ -202,6 +202,7 @@ static void sdcardSdio_init(const sdcardConfig_t *config, const spiPinConfig_t *
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_DMA_SPEC
|
#ifdef USE_DMA_SPEC
|
||||||
|
#if !defined(STM32H7) // H7 uses IDMA
|
||||||
const dmaChannelSpec_t *dmaChannelSpec = dmaGetChannelSpecByPeripheral(DMA_PERIPH_SDIO, 0, sdioConfig()->dmaopt);
|
const dmaChannelSpec_t *dmaChannelSpec = dmaGetChannelSpecByPeripheral(DMA_PERIPH_SDIO, 0, sdioConfig()->dmaopt);
|
||||||
|
|
||||||
if (!dmaChannelSpec) {
|
if (!dmaChannelSpec) {
|
||||||
|
@ -215,6 +216,7 @@ static void sdcardSdio_init(const sdcardConfig_t *config, const spiPinConfig_t *
|
||||||
sdcard.state = SDCARD_STATE_NOT_PRESENT;
|
sdcard.state = SDCARD_STATE_NOT_PRESENT;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
if (config->cardDetectTag) {
|
if (config->cardDetectTag) {
|
||||||
sdcard.cardDetectPin = IOGetByTag(config->cardDetectTag);
|
sdcard.cardDetectPin = IOGetByTag(config->cardDetectTag);
|
||||||
|
@ -230,7 +232,11 @@ static void sdcardSdio_init(const sdcardConfig_t *config, const spiPinConfig_t *
|
||||||
sdcard.useCache = 0;
|
sdcard.useCache = 0;
|
||||||
}
|
}
|
||||||
#ifdef USE_DMA_SPEC
|
#ifdef USE_DMA_SPEC
|
||||||
|
#if defined(STM32H7) // H7 uses IDMA
|
||||||
|
SD_Initialize_LL(0);
|
||||||
|
#else
|
||||||
SD_Initialize_LL(dmaChannelSpec->ref);
|
SD_Initialize_LL(dmaChannelSpec->ref);
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
SD_Initialize_LL(SDCARD_SDIO_DMA_OPT);
|
SD_Initialize_LL(SDCARD_SDIO_DMA_OPT);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue