mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
ipod6g, ata: Fix audio drop off while waiting for ata not busy
Change-Id: Id8fe39593fe3e6c5f0801bfa47ee1e04f7e7045f Reviewed-on: http://gerrit.rockbox.org/970 Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com> Tested: Nial Shui <nialv7@gmail.com>
This commit is contained in:
parent
f5e2c25cb8
commit
4a396ac1ed
1 changed files with 3 additions and 0 deletions
|
@ -131,6 +131,7 @@ static int ata_wait_for_not_bsy(long timeout)
|
|||
uint8_t csd = ata_read_cbr(&ATA_PIO_CSD);
|
||||
if (!(csd & BIT(7))) return 0;
|
||||
if (TIMEOUT_EXPIRED(startusec, timeout)) RET_ERR(0);
|
||||
yield();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -143,6 +144,7 @@ static int ata_wait_for_rdy(long timeout)
|
|||
uint8_t dad = ata_read_cbr(&ATA_PIO_DAD);
|
||||
if (dad & BIT(6)) return 0;
|
||||
if (TIMEOUT_EXPIRED(startusec, timeout)) RET_ERR(1);
|
||||
yield();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -156,6 +158,7 @@ static int ata_wait_for_start_of_transfer(long timeout)
|
|||
if (dad & BIT(0)) RET_ERR(1);
|
||||
if ((dad & (BIT(7) | BIT(3))) == BIT(3)) return 0;
|
||||
if (TIMEOUT_EXPIRED(startusec, timeout)) RET_ERR(2);
|
||||
yield();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue