aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-02-12 09:45:06 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-02-12 09:45:06 +0000
commitcf5dfef7a8e220f8d4d85edba664c526995ef8f6 (patch)
tree8b5db8b1b5c4cd72280fd415c89aadd4dd415cf6 /os
parentaab3b75fc1a7db54dff630b74158a673b88f8fa1 (diff)
downloadChibiOS-cf5dfef7a8e220f8d4d85edba664c526995ef8f6.tar.gz
ChibiOS-cf5dfef7a8e220f8d4d85edba664c526995ef8f6.tar.bz2
ChibiOS-cf5dfef7a8e220f8d4d85edba664c526995ef8f6.zip
Optimization in write operations of the MMC_SPI driver.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3953 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r--os/hal/src/mmc_spi.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/os/hal/src/mmc_spi.c b/os/hal/src/mmc_spi.c
index 06f2594bf..079dcf3c0 100644
--- a/os/hal/src/mmc_spi.c
+++ b/os/hal/src/mmc_spi.c
@@ -665,10 +665,8 @@ bool_t mmcSequentialWrite(MMCDriver *mmcp, const uint8_t *buffer) {
spiSend(mmcp->spip, MMC_SECTOR_SIZE, buffer); /* Data. */
spiIgnore(mmcp->spip, 2); /* CRC ignored. */
spiReceive(mmcp->spip, 1, b);
- if ((b[0] & 0x1F) == 0x05) {
- wait(mmcp);
+ if ((b[0] & 0x1F) == 0x05)
return FALSE;
- }
/* Error.*/
spiUnselect(mmcp->spip);
@@ -701,6 +699,10 @@ bool_t mmcStopSequentialWrite(MMCDriver *mmcp) {
}
chSysUnlock();
+ /* Wait completion of the last write operation.*/
+ wait(mmcp);
+
+ /* Semd stop command.*/
spiSend(mmcp->spip, sizeof(stop), stop);
spiUnselect(mmcp->spip);