diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-11-25 20:45:15 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-11-25 20:45:15 +0000 |
commit | 06593fd3966ffff2ad5fbaaa14bbf82c61c4bd6a (patch) | |
tree | b54d9b7d4665b1376204be10efe32ef0e50e778a /os/hal/platforms/STM32 | |
parent | c852dcb3c960198f49c5fdd8619a6d5d581d9136 (diff) | |
download | ChibiOS-06593fd3966ffff2ad5fbaaa14bbf82c61c4bd6a.tar.gz ChibiOS-06593fd3966ffff2ad5fbaaa14bbf82c61c4bd6a.tar.bz2 ChibiOS-06593fd3966ffff2ad5fbaaa14bbf82c61c4bd6a.zip |
STM32 SPI driver optimization.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2427 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/STM32')
-rw-r--r-- | os/hal/platforms/STM32/spi_lld.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/os/hal/platforms/STM32/spi_lld.c b/os/hal/platforms/STM32/spi_lld.c index d9abd5ba1..90e4305dc 100644 --- a/os/hal/platforms/STM32/spi_lld.c +++ b/os/hal/platforms/STM32/spi_lld.c @@ -391,10 +391,9 @@ void spi_lld_unselect(SPIDriver *spip) { void spi_lld_ignore(SPIDriver *spip, size_t n) {
dmaChannelSetup(spip->spd_dmarx, n, &dummyrx,
- spip->spd_dmaccr | DMA_CCR1_TCIE);
+ spip->spd_dmaccr | DMA_CCR1_TCIE | DMA_CCR1_EN);
dmaChannelSetup(spip->spd_dmatx, n, &dummytx,
- spip->spd_dmaccr | DMA_CCR1_DIR);
- dma_start(spip);
+ spip->spd_dmaccr | DMA_CCR1_DIR | DMA_CCR1_EN);
}
/**
@@ -416,10 +415,11 @@ void spi_lld_exchange(SPIDriver *spip, size_t n, const void *txbuf, void *rxbuf) {
dmaChannelSetup(spip->spd_dmarx, n, rxbuf,
- spip->spd_dmaccr | DMA_CCR1_TCIE | DMA_CCR1_MINC);
+ spip->spd_dmaccr | DMA_CCR1_TCIE | DMA_CCR1_MINC |
+ DMA_CCR1_EN);
dmaChannelSetup(spip->spd_dmatx, n, txbuf,
- spip->spd_dmaccr | DMA_CCR1_DIR | DMA_CCR1_MINC);
- dma_start(spip);
+ spip->spd_dmaccr | DMA_CCR1_DIR | DMA_CCR1_MINC |
+ DMA_CCR1_EN);
}
/**
@@ -438,10 +438,10 @@ void spi_lld_exchange(SPIDriver *spip, size_t n, void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) {
dmaChannelSetup(spip->spd_dmarx, n, &dummyrx,
- spip->spd_dmaccr | DMA_CCR1_TCIE);
+ spip->spd_dmaccr | DMA_CCR1_TCIE | DMA_CCR1_EN);
dmaChannelSetup(spip->spd_dmatx, n, txbuf,
- spip->spd_dmaccr | DMA_CCR1_DIR | DMA_CCR1_MINC);
- dma_start(spip);
+ spip->spd_dmaccr | DMA_CCR1_DIR | DMA_CCR1_MINC |
+ DMA_CCR1_EN);
}
/**
@@ -460,10 +460,10 @@ void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) { void spi_lld_receive(SPIDriver *spip, size_t n, void *rxbuf) {
dmaChannelSetup(spip->spd_dmarx, n, rxbuf,
- spip->spd_dmaccr | DMA_CCR1_TCIE | DMA_CCR1_MINC);
+ spip->spd_dmaccr | DMA_CCR1_TCIE | DMA_CCR1_MINC |
+ DMA_CCR1_EN);
dmaChannelSetup(spip->spd_dmatx, n, &dummytx,
- spip->spd_dmaccr | DMA_CCR1_DIR);
- dma_start(spip);
+ spip->spd_dmaccr | DMA_CCR1_DIR | DMA_CCR1_EN);
}
/**
|