aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms/STM32/sdc_lld.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-06-26 18:18:14 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-06-26 18:18:14 +0000
commit9492ff4976cb9e8af40c9a6715b7d9f7ef5f9428 (patch)
tree1f6a61a57f6502c1c072cc1f0834da6d006919df /os/hal/platforms/STM32/sdc_lld.c
parent853b0fd51c80d9b8640639321a950f16800d57d4 (diff)
downloadChibiOS-9492ff4976cb9e8af40c9a6715b7d9f7ef5f9428.tar.gz
ChibiOS-9492ff4976cb9e8af40c9a6715b7d9f7ef5f9428.tar.bz2
ChibiOS-9492ff4976cb9e8af40c9a6715b7d9f7ef5f9428.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4349 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/STM32/sdc_lld.c')
-rw-r--r--os/hal/platforms/STM32/sdc_lld.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c
index 84eb66b0b..77b20d242 100644
--- a/os/hal/platforms/STM32/sdc_lld.c
+++ b/os/hal/platforms/STM32/sdc_lld.c
@@ -41,8 +41,8 @@
/* Driver local definitions. */
/*===========================================================================*/
-#define DMA_CHANNEL \
- STM32_DMA_GETCHANNEL(STM32_SDC_SDIO_DMA_STREAM, \
+#define DMA_CHANNEL \
+ STM32_DMA_GETCHANNEL(STM32_SDC_SDIO_DMA_STREAM, \
STM32_SDC_SDIO_DMA_CHN)
/*===========================================================================*/
@@ -346,7 +346,7 @@ void sdc_lld_start(SDCDriver *sdcp) {
STM32_DMA_CR_MBURST_INCR4;
#endif
- if (sdcp->state == SDC_STOP) {
+ if (sdcp->state == BLK_STOP) {
/* Note, the DMA must be enabled before the IRQs.*/
bool_t b;
b = dmaStreamAllocate(sdcp->dma, STM32_SDC_SDIO_IRQ_PRIORITY, NULL, NULL);
@@ -376,7 +376,9 @@ void sdc_lld_start(SDCDriver *sdcp) {
*/
void sdc_lld_stop(SDCDriver *sdcp) {
- if ((sdcp->state == SDC_READY) || (sdcp->state == SDC_ACTIVE)) {
+ if (sdcp->state != BLK_STOP) {
+
+ /* SDIO deactivation.*/
SDIO->POWER = 0;
SDIO->CLKCR = 0;
SDIO->DCTRL = 0;