aboutsummaryrefslogtreecommitdiffstats
path: root/os/io/mmc_spi.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-11-20 15:51:19 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-11-20 15:51:19 +0000
commit5f84b30ea1f8bfc4351c0784782075ae806dbf1c (patch)
tree95834c3650270b2f272e085f785c9ff5ccd18c36 /os/io/mmc_spi.c
parent2ab27d3c01ce51a26587e6aaafcef23b2dda4afe (diff)
downloadChibiOS-5f84b30ea1f8bfc4351c0784782075ae806dbf1c.tar.gz
ChibiOS-5f84b30ea1f8bfc4351c0784782075ae806dbf1c.tar.bz2
ChibiOS-5f84b30ea1f8bfc4351c0784782075ae806dbf1c.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1316 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/io/mmc_spi.c')
-rw-r--r--os/io/mmc_spi.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/os/io/mmc_spi.c b/os/io/mmc_spi.c
index 4013f45f5..4f6adaf7d 100644
--- a/os/io/mmc_spi.c
+++ b/os/io/mmc_spi.c
@@ -488,7 +488,7 @@ bool_t mmcStartSequentialWrite(MMCDriver *mmcp, uint32_t startblk) {
if (recvr1(mmcp) != 0x00) {
spiUnselect(mmcp->mmc_spip);
chSysLock();
- if (mmcp->mmc_state == MMC_READING)
+ if (mmcp->mmc_state == MMC_WRITING)
mmcp->mmc_state = MMC_READY;
chSysUnlock();
return TRUE;
@@ -560,8 +560,11 @@ bool_t mmcStopSequentialWrite(MMCDriver *mmcp) {
spiUnselect(mmcp->mmc_spip);
chSysLock();
- if (mmcp->mmc_state == MMC_WRITING)
+ if (mmcp->mmc_state == MMC_WRITING) {
mmcp->mmc_state = MMC_READY;
+ chSysUnlock();
+ return FALSE;
+ }
chSysUnlock();
return TRUE;
}