git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2917 35acf78f-673a-0410-8e92-d51de3d6d3f4

This commit is contained in:
gdisirio 2011-05-03 20:36:44 +00:00
parent f6ed2f2a84
commit 3e42a8fe76
2 changed files with 8 additions and 3 deletions

View File

@ -319,6 +319,11 @@ bool_t sdc_lld_read_blocks(SDCDriver *sdcp, uint8_t *buf, uint32_t n) {
msg_t msg; msg_t msg;
chSysLock(); chSysLock();
dmaChannelSetup(&STM32_DMA2->channels[STM32_DMA_CHANNEL_4],
n * SDC_BLOCK_SIZE, buf,
(STM32_SDC_SDIO_DMA_PRIORITY << 12) |
DMA_CCR1_MINC | DMA_CCR1_EN);
chDbgAssert(sdcp->thread == NULL, "sdc_lld_read_blocks(), #1", "not NULL"); chDbgAssert(sdcp->thread == NULL, "sdc_lld_read_blocks(), #1", "not NULL");
sdcp->thread = chThdSelf(); sdcp->thread = chThdSelf();
chSchGoSleepS(THD_STATE_SUSPENDED); chSchGoSleepS(THD_STATE_SUSPENDED);

View File

@ -230,11 +230,11 @@ void spi_lld_start(SPIDriver *spip) {
/* More DMA setup.*/ /* More DMA setup.*/
if ((spip->config->cr1 & SPI_CR1_DFF) == 0) if ((spip->config->cr1 & SPI_CR1_DFF) == 0)
spip->dmaccr = (STM32_SPI_SPI2_DMA_PRIORITY << 12) | spip->dmaccr = (STM32_SPI_SPI2_DMA_PRIORITY << 12) |
DMA_CCR1_TEIE; /* 8 bits transfers. */ DMA_CCR1_TEIE; /* 8 bits transfers. */
else else
spip->dmaccr = (STM32_SPI_SPI2_DMA_PRIORITY << 12) | spip->dmaccr = (STM32_SPI_SPI2_DMA_PRIORITY << 12) |
DMA_CCR1_TEIE | DMA_CCR1_MSIZE_0 | DMA_CCR1_TEIE | DMA_CCR1_MSIZE_0 |
DMA_CCR1_PSIZE_0; /* 16 bits transfers. */ DMA_CCR1_PSIZE_0; /* 16 bits transfers. */
/* SPI setup and enable.*/ /* SPI setup and enable.*/
spip->spi->CR1 = 0; spip->spi->CR1 = 0;