1
0
Fork 0
forked from len0rd/rockbox

Fixed spindown bug: last_disk_activity was set 10 seconds into the future, which resulted in too long spindown delays.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3826 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Björn Stenberg 2003-07-10 13:32:15 +00:00
parent 4b392cd105
commit c695f26c9f

View file

@ -110,9 +110,10 @@ static int wait_for_bsy(void) __attribute__ ((section (".icode")));
static int wait_for_bsy(void) static int wait_for_bsy(void)
{ {
int timeout = current_tick + HZ*10; int timeout = current_tick + HZ*10;
last_disk_activity = timeout; while (TIME_BEFORE(current_tick, timeout) && (ATA_STATUS & STATUS_BSY)) {
while (TIME_BEFORE(current_tick, timeout) && (ATA_STATUS & STATUS_BSY)) last_disk_activity = current_tick;
yield(); yield();
}
if (TIME_BEFORE(current_tick, timeout)) if (TIME_BEFORE(current_tick, timeout))
return 1; return 1;
@ -129,10 +130,12 @@ static int wait_for_rdy(void)
return 0; return 0;
timeout = current_tick + HZ*10; timeout = current_tick + HZ*10;
last_disk_activity = timeout;
while (TIME_BEFORE(current_tick, timeout) && !(ATA_ALT_STATUS & STATUS_RDY)) while (TIME_BEFORE(current_tick, timeout) &&
!(ATA_ALT_STATUS & STATUS_RDY)) {
last_disk_activity = current_tick;
yield(); yield();
}
if (TIME_BEFORE(current_tick, timeout)) if (TIME_BEFORE(current_tick, timeout))
return STATUS_RDY; return STATUS_RDY;