aboutsummaryrefslogtreecommitdiffstats
path: root/os/io/mmc_spi.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-11-10 22:13:59 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-11-10 22:13:59 +0000
commit176444320c3c32bd35180ffcdbbda7be0cfd23bc (patch)
treeabdbcd42f2a02eff714fb0fbd3224e0cb6cc17dd /os/io/mmc_spi.c
parente48e822aa8ec66fc9daac05e387ffb77d8f5c452 (diff)
downloadChibiOS-176444320c3c32bd35180ffcdbbda7be0cfd23bc.tar.gz
ChibiOS-176444320c3c32bd35180ffcdbbda7be0cfd23bc.tar.bz2
ChibiOS-176444320c3c32bd35180ffcdbbda7be0cfd23bc.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1281 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/io/mmc_spi.c')
-rw-r--r--os/io/mmc_spi.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/os/io/mmc_spi.c b/os/io/mmc_spi.c
index 6a2407a6a..42100bb61 100644
--- a/os/io/mmc_spi.c
+++ b/os/io/mmc_spi.c
@@ -372,6 +372,8 @@ bool_t mmcSequentialRead(MMCDriver *mmcp, uint8_t *buffer) {
* @retval TRUE the operation failed.
*/
bool_t mmcStopSequentialRead(MMCDriver *mmcp) {
+ static const uint8_t stopcmd[] = {0x40 | MMC_CMDSTOP, 0, 0, 0, 0, 1, 0xFF};
+ bool_t result;
chDbgCheck(mmcp != NULL, "mmcStopSequentialRead");
@@ -382,11 +384,15 @@ bool_t mmcStopSequentialRead(MMCDriver *mmcp) {
}
chSysUnlock();
+ spiSend(mmcp->mmc_spip, sizeof(stopcmd), stopcmd);
+ result = recvr1(mmcp) != 0x00;
+ spiUnselect(mmcp->mmc_spip);
+
chSysLock();
if (mmcp->mmc_state == MMC_READING)
mmcp->mmc_state = MMC_READY;
chSysUnlock();
- return FALSE;
+ return result;
}
/** @} */