From 502e9e97b6c91999e6d0d92802e59d13d8ffc9de Mon Sep 17 00:00:00 2001 From: Bertrik Sikken Date: Sat, 26 Mar 2011 21:22:30 +0000 Subject: AMSv2 SD: wait for response to command SD_STOP_TRANSMISSION instead of ignoring the response git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29651 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/as3525/sd-as3525v2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c index 93dc7444c5..45b7b69be5 100644 --- a/firmware/target/arm/as3525/sd-as3525v2.c +++ b/firmware/target/arm/as3525/sd-as3525v2.c @@ -823,6 +823,7 @@ int sd_init(void) static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start, int count, void* buf, bool write) { + unsigned long response; int ret = 0; #ifndef HAVE_MULTIDRIVE const int drive = 0; @@ -938,8 +939,7 @@ sd_transfer_retry_with_reinit: dma_enable_channel(0, MCI_FIFO, dma_buf, DMA_PERI_SD, DMAC_FLOWCTRL_PERI_PERI_TO_MEM, false, true, 0, DMA_S8, NULL); - unsigned long dummy; /* if we don't ask for a response, writing fails */ - if(!send_cmd(drive, cmd, arg, MCI_RESP, &dummy)) + if(!send_cmd(drive, cmd, arg, MCI_RESP, &response)) { ret = -21; goto sd_transfer_error; @@ -955,7 +955,7 @@ sd_transfer_retry_with_reinit: while(MCI_STATUS & DATA_BUSY) ; } - if(!send_cmd(drive, SD_STOP_TRANSMISSION, 0, MCI_NO_RESP, NULL)) + if(!send_cmd(drive, SD_STOP_TRANSMISSION, 0, MCI_RESP, &response)) { ret = -22; goto sd_transfer_error; -- cgit