git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4116 35acf78f-673a-0410-8e92-d51de3d6d3f4
parent
2446f558db
commit
0c9da34878
|
@ -176,25 +176,22 @@ static bool_t sdc_lld_wait_transaction_end(SDCDriver *sdcp, uint32_t n,
|
||||||
return CH_FAILED;
|
return CH_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Wait until DMA channel enabled to be sure that all data transferred.*/
|
/* Waits for transfer completion at DMA level, the the stream is
|
||||||
while (sdcp->dma->stream->CR & STM32_DMA_CR_EN)
|
disabled and cleared.*/
|
||||||
;
|
dmaWaitCompletion(sdcp->dma);
|
||||||
|
|
||||||
/* DMA event flags must be manually cleared.*/
|
|
||||||
dmaStreamClearInterrupt(sdcp->dma);
|
|
||||||
|
|
||||||
SDIO->ICR = STM32_SDIO_ICR_ALL_FLAGS;
|
SDIO->ICR = STM32_SDIO_ICR_ALL_FLAGS;
|
||||||
SDIO->DCTRL = 0;
|
SDIO->DCTRL = 0;
|
||||||
chSysUnlock();
|
chSysUnlock();
|
||||||
|
|
||||||
/* Wait until interrupt flags to be cleared.*/
|
/* Wait until interrupt flags to be cleared.*/
|
||||||
while (((DMA2->LISR) >> (sdcp->dma->ishift)) & STM32_DMA_ISR_TCIF)
|
/* while (((DMA2->LISR) >> (sdcp->dma->ishift)) & STM32_DMA_ISR_TCIF)
|
||||||
dmaStreamClearInterrupt(sdcp->dma);
|
dmaStreamClearInterrupt(sdcp->dma);*/
|
||||||
|
|
||||||
/* Finalize transaction.*/
|
/* Finalize transaction.*/
|
||||||
if (n > 1)
|
if (n > 1)
|
||||||
return sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_STOP_TRANSMISSION, 0, resp);
|
return sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_STOP_TRANSMISSION, 0, resp);
|
||||||
else
|
|
||||||
return CH_SUCCESS;
|
return CH_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue