forked from len0rd/rockbox
Work around a bug in the Sansa flash driver
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12187 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
a7af649766
commit
67ec6177a7
1 changed files with 8 additions and 21 deletions
|
|
@ -267,8 +267,6 @@ static void copy_write_sectors(const unsigned char* buf, int wordcount)
|
|||
|
||||
static void copy_write_sectors(const unsigned char* buf, int wordcount)
|
||||
{
|
||||
if ( (unsigned long)buf & 1)
|
||||
{ /* not 16-bit aligned, copy byte by byte */
|
||||
unsigned short tmp = 0;
|
||||
const unsigned char* bufend = buf + wordcount*2;
|
||||
do
|
||||
|
|
@ -278,17 +276,6 @@ static void copy_write_sectors(const unsigned char* buf, int wordcount)
|
|||
DATA_REG = tmp;
|
||||
} while (buf < bufend); /* tail loop is faster */
|
||||
}
|
||||
else
|
||||
{ /* 16-bit aligned, can do faster copy */
|
||||
unsigned short* wbuf = (unsigned short*)buf;
|
||||
unsigned short* wbufend = wbuf + wordcount;
|
||||
do
|
||||
{
|
||||
DATA_REG = *wbuf;
|
||||
asm volatile("nop\n\t");
|
||||
} while (++wbuf < wbufend); /* tail loop is faster */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void sd_select_bank(unsigned char bank)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue