1
0
Fork 0
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:
Rob Purchase 2009-06-22 18:06:08 +00:00
parent 4b831753e7
commit 67c86a76d9

View file

@ -40,6 +40,9 @@ long last_disk_activity = -1;
/** static, private data **/
static bool initialized = false;
static long next_yield = 0;
#define MIN_YIELD_PERIOD 1000
static struct mutex ata_mtx SHAREDBSS_ATTR;
#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;
}
#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;
incount--;
secmod++;