File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
bsp/stm32f429-apollo/drivers Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -526,6 +526,7 @@ struct stm32f4_spi stm32f4_spi5 =
526526 /* .spi_handle = */ {
527527 /* .Instance = */ SPI5 ,
528528 },
529+ #ifdef SPI_USE_DMA
529530 /* .hdma_rx = */ {
530531 DMA2_Stream3 ,
531532 DMA_CHANNEL_2 ,
@@ -537,6 +538,7 @@ struct stm32f4_spi stm32f4_spi5 =
537538 DMA_CHANNEL_2 ,
538539 },
539540 /* .hdma_tx_irq = */ DMA2_Stream4_IRQn ,
541+ #endif /* SPI_USE_DMA */
540542};
541543
542544static struct rt_spi_bus spi5_bus ;
@@ -703,6 +705,7 @@ rt_err_t stm32_spi_bus_register(SPI_TypeDef * SPI,
703705 return RT_ENOSYS ;
704706 }
705707
708+ #ifdef SPI_USE_DMA
706709 /* Configure the DMA handler for Transmission process */
707710 p_spi_bus -> hdma_tx .Init .Direction = DMA_MEMORY_TO_PERIPH ;
708711 p_spi_bus -> hdma_tx .Init .PeriphInc = DMA_PINC_DISABLE ;
@@ -727,6 +730,7 @@ rt_err_t stm32_spi_bus_register(SPI_TypeDef * SPI,
727730 p_spi_bus -> hdma_rx .Init .FIFOThreshold = DMA_FIFO_THRESHOLD_FULL ;
728731 p_spi_bus -> hdma_rx .Init .MemBurst = DMA_MBURST_INC4 ;
729732 p_spi_bus -> hdma_rx .Init .PeriphBurst = DMA_PBURST_INC4 ;
733+ #endif /* SPI_USE_DMA */
730734
731735 spi_bus -> parent .user_data = & stm32f4_spi5 ;
732736
Original file line number Diff line number Diff line change 2020
2121#include "stm32f4xx_hal.h"
2222
23- #define SPI_USE_DMA
23+ // #define SPI_USE_DMA
2424
2525struct stm32f4_spi
2626{
You can’t perform that action at this time.
0 commit comments