diff options
| author | Bernard Xiong <[email protected]> | 2018-05-31 17:47:25 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2018-05-31 17:47:25 +0800 |
| commit | 37d8cc4ff2435ad2eeb6cae44a2d602b9fa5e613 (patch) | |
| tree | 6a5bd55f57a76aebf35ad51458db86d668eeef72 /bsp/stm32f429-apollo/drivers/drv_spi.c | |
| parent | b91257edb2dd0aa0b24db49c35ec1c973f20c7f8 (diff) | |
| parent | 0b1b5497426f6e2b15cd7f1ec5b1fe61defb5499 (diff) | |
Merge pull request #1495 from armink/fix_apollo429v3.0.4
Fix apollo429
Diffstat (limited to 'bsp/stm32f429-apollo/drivers/drv_spi.c')
| -rw-r--r-- | bsp/stm32f429-apollo/drivers/drv_spi.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/bsp/stm32f429-apollo/drivers/drv_spi.c b/bsp/stm32f429-apollo/drivers/drv_spi.c index e7b547cce2..a82454d907 100644 --- a/bsp/stm32f429-apollo/drivers/drv_spi.c +++ b/bsp/stm32f429-apollo/drivers/drv_spi.c @@ -526,6 +526,7 @@ struct stm32f4_spi stm32f4_spi5 = /* .spi_handle = */{ /* .Instance = */ SPI5, }, +#ifdef SPI_USE_DMA /* .hdma_rx = */ { DMA2_Stream3, DMA_CHANNEL_2, @@ -537,6 +538,7 @@ struct stm32f4_spi stm32f4_spi5 = DMA_CHANNEL_2, }, /* .hdma_tx_irq = */ DMA2_Stream4_IRQn, +#endif /* SPI_USE_DMA */ }; static struct rt_spi_bus spi5_bus; @@ -703,6 +705,7 @@ rt_err_t stm32_spi_bus_register(SPI_TypeDef * SPI, return RT_ENOSYS; } +#ifdef SPI_USE_DMA /* Configure the DMA handler for Transmission process */ p_spi_bus->hdma_tx.Init.Direction = DMA_MEMORY_TO_PERIPH; p_spi_bus->hdma_tx.Init.PeriphInc = DMA_PINC_DISABLE; @@ -727,6 +730,7 @@ rt_err_t stm32_spi_bus_register(SPI_TypeDef * SPI, p_spi_bus->hdma_rx.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL; p_spi_bus->hdma_rx.Init.MemBurst = DMA_MBURST_INC4; p_spi_bus->hdma_rx.Init.PeriphBurst = DMA_PBURST_INC4; +#endif /* SPI_USE_DMA */ spi_bus->parent.user_data = &stm32f4_spi5; |
