File tree 2 files changed +5
-1
lines changed
bsp/stm32f429-apollo/drivers
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 =
526
526
/* .spi_handle = */ {
527
527
/* .Instance = */ SPI5 ,
528
528
},
529
+ #ifdef SPI_USE_DMA
529
530
/* .hdma_rx = */ {
530
531
DMA2_Stream3 ,
531
532
DMA_CHANNEL_2 ,
@@ -537,6 +538,7 @@ struct stm32f4_spi stm32f4_spi5 =
537
538
DMA_CHANNEL_2 ,
538
539
},
539
540
/* .hdma_tx_irq = */ DMA2_Stream4_IRQn ,
541
+ #endif /* SPI_USE_DMA */
540
542
};
541
543
542
544
static struct rt_spi_bus spi5_bus ;
@@ -703,6 +705,7 @@ rt_err_t stm32_spi_bus_register(SPI_TypeDef * SPI,
703
705
return RT_ENOSYS ;
704
706
}
705
707
708
+ #ifdef SPI_USE_DMA
706
709
/* Configure the DMA handler for Transmission process */
707
710
p_spi_bus -> hdma_tx .Init .Direction = DMA_MEMORY_TO_PERIPH ;
708
711
p_spi_bus -> hdma_tx .Init .PeriphInc = DMA_PINC_DISABLE ;
@@ -727,6 +730,7 @@ rt_err_t stm32_spi_bus_register(SPI_TypeDef * SPI,
727
730
p_spi_bus -> hdma_rx .Init .FIFOThreshold = DMA_FIFO_THRESHOLD_FULL ;
728
731
p_spi_bus -> hdma_rx .Init .MemBurst = DMA_MBURST_INC4 ;
729
732
p_spi_bus -> hdma_rx .Init .PeriphBurst = DMA_PBURST_INC4 ;
733
+ #endif /* SPI_USE_DMA */
730
734
731
735
spi_bus -> parent .user_data = & stm32f4_spi5 ;
732
736
Original file line number Diff line number Diff line change 20
20
21
21
#include "stm32f4xx_hal.h"
22
22
23
- #define SPI_USE_DMA
23
+ // #define SPI_USE_DMA
24
24
25
25
struct stm32f4_spi
26
26
{
You can’t perform that action at this time.
0 commit comments