Fixed busy timeout handling; better comments
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5240 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
dd937dcfaf
commit
0660105af2
1 changed files with 6 additions and 4 deletions
|
@ -246,7 +246,8 @@ static void read_transfer(unsigned char *buf, int len)
|
|||
*buf = fliptable[(signed char)(RDR1)]; /* read & bitswap */
|
||||
}
|
||||
|
||||
static unsigned char poll_byte(int timeout) /* timeout is in bytes */
|
||||
/* returns 0xFF on timeout, timeout is in bytes */
|
||||
static unsigned char poll_byte(int timeout)
|
||||
{
|
||||
int i;
|
||||
unsigned char data = 0; /* stop the compiler complaining */
|
||||
|
@ -264,7 +265,8 @@ static unsigned char poll_byte(int timeout) /* timeout is in bytes */
|
|||
return fliptable[(signed char)data];
|
||||
}
|
||||
|
||||
static unsigned char poll_busy(int timeout) /* timeout is in bytes */
|
||||
/* returns 0 on timeout, timeout is in bytes */
|
||||
static unsigned char poll_busy(int timeout)
|
||||
{
|
||||
int i;
|
||||
unsigned char data, dummy;
|
||||
|
@ -285,7 +287,7 @@ static unsigned char poll_busy(int timeout) /* timeout is in bytes */
|
|||
dummy = RDR1; /* read byte */
|
||||
} while ((dummy != 0xFF) && (++i < timeout));
|
||||
|
||||
return data;
|
||||
return (dummy == 0xFF) ? data : 0;
|
||||
}
|
||||
|
||||
/* Send MMC command and get response */
|
||||
|
@ -734,7 +736,7 @@ void ata_spindown(int seconds)
|
|||
}
|
||||
|
||||
bool ata_disk_is_active(void)
|
||||
{
|
||||
{
|
||||
/* this is correct unless early return from write gets implemented */
|
||||
return mmc_mutex.locked;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue