summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorJack Halpin <jack.halpin@gmail.com>2010-03-22 06:09:08 +0000
committerJack Halpin <jack.halpin@gmail.com>2010-03-22 06:09:08 +0000
commitd2a264e7dae9f716dfbf8e6b2167e461d1a6bf5a (patch)
tree00d7781f09c177f70f19866a916130d403074343 /firmware
parent3ee301248d3eb6150f500b86412f3cf7667d17c4 (diff)
downloadrockbox-d2a264e7dae9f716dfbf8e6b2167e461d1a6bf5a.tar.gz
rockbox-d2a264e7dae9f716dfbf8e6b2167e461d1a6bf5a.tar.bz2
rockbox-d2a264e7dae9f716dfbf8e6b2167e461d1a6bf5a.zip
sd-as3525v2.c Use MCI_MASK instead of data_transfer flag to determine if data transfer is happening.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25284 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/arm/as3525/sd-as3525v2.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c
index b696908157..2fec4d9404 100644
--- a/firmware/target/arm/as3525/sd-as3525v2.c
+++ b/firmware/target/arm/as3525/sd-as3525v2.c
@@ -336,7 +336,6 @@ bool sd_enabled = false;
static struct wakeup transfer_completion_signal;
static volatile bool retry;
-static volatile bool data_transfer = false;
#if defined(HAVE_MULTIDRIVE)
int active_card = 0;
@@ -354,7 +353,7 @@ void INT_NAND(void)
if(status & MCI_DATA_ERROR)
retry = true;
- if(data_transfer && status & (MCI_INT_DTO|MCI_DATA_ERROR))
+ if( status & (MCI_INT_DTO|MCI_DATA_ERROR))
wakeup_signal(&transfer_completion_signal);
MCI_CTRL |= INT_ENABLE;
@@ -793,14 +792,12 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start,
goto sd_transfer_error;
}
-
- MCI_MASK = MCI_DATA_ERROR | MCI_INT_DTO;
+ MCI_MASK |= (MCI_DATA_ERROR | MCI_INT_DTO);
MCI_CTRL |= DMA_ENABLE;
MCI_FIFOTH &= MCI_FIFOTH_MASK;
MCI_FIFOTH |= 0x503f0080;
-
int arg = start;
if(!(card_info[drive].ocr & (1<<30))) /* not SDHC */
arg *= SD_BLOCK_SIZE;
@@ -815,9 +812,9 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start,
dma_enable_channel(0, MCI_FIFO, dma_buf, DMA_PERI_SD,
DMAC_FLOWCTRL_PERI_PERI_TO_MEM, false, true, 0, DMA_S8, NULL);
- data_transfer = true;
wakeup_wait(&transfer_completion_signal, TIMEOUT_BLOCK);
- data_transfer = false;
+
+ MCI_MASK &= ~(MCI_DATA_ERROR | MCI_INT_DTO);
last_disk_activity = current_tick;