diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-05-08 06:12:09 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-05-08 06:12:09 +0000 |
commit | f6c6d6ca848c449727a57b83491e4b2ae0d868a3 (patch) | |
tree | f43f114afda2b3cf82932a4515a726bf038ed54f /os | |
parent | a8ea499b27805ce5fa109f64cfff073c9b077f3b (diff) | |
download | ChibiOS-f6c6d6ca848c449727a57b83491e4b2ae0d868a3.tar.gz ChibiOS-f6c6d6ca848c449727a57b83491e4b2ae0d868a3.tar.bz2 ChibiOS-f6c6d6ca848c449727a57b83491e4b2ae0d868a3.zip |
Now the driver is able to read blocks.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2928 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r-- | os/hal/platforms/STM32/sdc_lld.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/os/hal/platforms/STM32/sdc_lld.c b/os/hal/platforms/STM32/sdc_lld.c index 8afb41509..74ffd4184 100644 --- a/os/hal/platforms/STM32/sdc_lld.c +++ b/os/hal/platforms/STM32/sdc_lld.c @@ -70,6 +70,8 @@ CH_IRQ_HANDLER(SDIO_IRQHandler) { }
chSysUnlockFromIsr();
+ SDIO->ICR = 0xFFFFFFFF;
+
CH_IRQ_EPILOGUE();
}
@@ -345,8 +347,8 @@ bool_t sdc_lld_read(SDCDriver *sdcp, uint32_t startblk, SDIO->MASK = SDIO_MASK_DCRCFAILIE | SDIO_MASK_DTIMEOUTIE |
SDIO_MASK_DATAENDIE | SDIO_MASK_STBITERRIE;
SDIO->DLEN = n * SDC_BLOCK_SIZE;
- SDIO->DCTRL = SDIO_DCTRL_RWMOD |
- SDIO_DCTRL_DBLOCKSIZE_3 | SDIO_DCTRL_DBLOCKSIZE_3 |
+ SDIO->DCTRL = SDIO_DCTRL_DTDIR |
+ SDIO_DCTRL_DBLOCKSIZE_3 | SDIO_DCTRL_DBLOCKSIZE_0 |
SDIO_DCTRL_DMAEN |
SDIO_DCTRL_DTEN;
@@ -377,6 +379,10 @@ bool_t sdc_lld_read(SDCDriver *sdcp, uint32_t startblk, goto error;
}
}
+ dmaDisableChannel(STM32_DMA2, STM32_DMA_CHANNEL_4);
+ SDIO->ICR = 0xFFFFFFFF;
+ SDIO->MASK = 0;
+ SDIO->DCTRL = 0;
chSysUnlock();
if (sdc_lld_send_cmd_short_crc(sdcp, SDC_CMD_STOP_TRANSMISSION, 0, resp))
|