forked from len0rd/rockbox
TCC78x: Make the NAND driver yield during reads (thanks to bertrik for spotting the obvious error that caused this to crash until now). Fixes the D2 'delay before playback starts' bug.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21465 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
4b831753e7
commit
67c86a76d9
1 changed files with 11 additions and 0 deletions
|
@ -40,6 +40,9 @@ long last_disk_activity = -1;
|
||||||
/** static, private data **/
|
/** static, private data **/
|
||||||
static bool initialized = false;
|
static bool initialized = false;
|
||||||
|
|
||||||
|
static long next_yield = 0;
|
||||||
|
#define MIN_YIELD_PERIOD 1000
|
||||||
|
|
||||||
static struct mutex ata_mtx SHAREDBSS_ATTR;
|
static struct mutex ata_mtx SHAREDBSS_ATTR;
|
||||||
|
|
||||||
#if defined(COWON_D2) || defined(IAUDIO_7)
|
#if defined(COWON_D2) || defined(IAUDIO_7)
|
||||||
|
@ -714,6 +717,14 @@ int nand_read_sectors(IF_MV2(int drive,) unsigned long start, int incount,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CPU_TCC780X /* 77x doesn't have USEC_TIMER yet */
|
||||||
|
if (TIME_AFTER(USEC_TIMER, next_yield))
|
||||||
|
{
|
||||||
|
next_yield = USEC_TIMER + MIN_YIELD_PERIOD;
|
||||||
|
yield();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
inbuf += SECTOR_SIZE;
|
inbuf += SECTOR_SIZE;
|
||||||
incount--;
|
incount--;
|
||||||
secmod++;
|
secmod++;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue