diff options
author | dpslwk <dps.lwk@gmail.com> | 2016-06-29 12:26:21 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-06-29 14:28:49 +0100 |
commit | b03df60f32c977a8a272cdeeaf1812f79918e69c (patch) | |
tree | 8ece36f5975be0c405fa37250b3a7cb6cc3f26c9 | |
parent | 14b7c3e59c929ed3a0ac4dd91a77d5dd9d555abc (diff) | |
download | micropython-b03df60f32c977a8a272cdeeaf1812f79918e69c.tar.gz micropython-b03df60f32c977a8a272cdeeaf1812f79918e69c.zip |
stmhal: Correct DMA to allow SD card on L4 MCUs.
-rw-r--r-- | stmhal/dma.c | 4 | ||||
-rw-r--r-- | stmhal/dma.h | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/stmhal/dma.c b/stmhal/dma.c index 9f3e87fb9e..218d0fbef2 100644 --- a/stmhal/dma.c +++ b/stmhal/dma.c @@ -267,8 +267,10 @@ const dma_descr_t dma_ADC_2_RX = { DMA2_Channel4, DMA_REQUEST_0, DMA_PERIPH_TO_M const dma_descr_t dma_DAC_1_TX = { DMA2_Channel4, DMA_REQUEST_3, DMA_MEMORY_TO_PERIPH, dma_id_10, &dma_init_struct_dac }; const dma_descr_t dma_SPI_1_TX = { DMA2_Channel4, DMA_REQUEST_4, DMA_MEMORY_TO_PERIPH, dma_id_10, &dma_init_struct_spi_i2c }; */ -#if MICROPY_HW_HAS_SDCARD +#if defined(MICROPY_HW_HAS_SDCARD) && MICROPY_HW_HAS_SDCARD +// defined twice as L4 HAL only needs one channel and can correctly switch direction but sdcard.c needs two channels const dma_descr_t dma_SDIO_0_TX= { DMA2_Channel4, DMA_REQUEST_7, DMA_MEMORY_TO_PERIPH, dma_id_10, &dma_init_struct_sdio }; +const dma_descr_t dma_SDIO_0_RX= { DMA2_Channel4, DMA_REQUEST_7, DMA_PERIPH_TO_MEMORY, dma_id_10, &dma_init_struct_sdio }; #endif /* not preferred streams const dma_descr_t dma_ADC_3_RX = { DMA2_Channel5, DMA_REQUEST_0, DMA_PERIPH_TO_MEMORY, dma_id_11, NULL }; diff --git a/stmhal/dma.h b/stmhal/dma.h index 5880029f3d..5199bd3721 100644 --- a/stmhal/dma.h +++ b/stmhal/dma.h @@ -73,7 +73,8 @@ extern const dma_descr_t dma_I2C_1_TX; extern const dma_descr_t dma_I2C_1_RX; extern const dma_descr_t dma_SPI_3_RX; extern const dma_descr_t dma_SPI_3_TX; -extern const dma_descr_t dma_SDIO_1_TX; +extern const dma_descr_t dma_SDIO_0_TX; +extern const dma_descr_t dma_SDIO_0_RX; #endif |