Merge pull request #583 from gsomlo/gls-sdcard-timeout
liblitesdcard/sdcard: adjust card-ready timeout
This commit is contained in:
commit
0a3095ead2
|
@ -462,15 +462,13 @@ int sdcard_init(void) {
|
||||||
busy_wait(1);
|
busy_wait(1);
|
||||||
sdcard_send_ext_csd();
|
sdcard_send_ext_csd();
|
||||||
/* wait for card to be ready */
|
/* wait for card to be ready */
|
||||||
timeout = 10;
|
for (timeout = 128; timeout > 0; timeout--) {
|
||||||
while (timeout) {
|
|
||||||
sdcard_app_cmd(0);
|
sdcard_app_cmd(0);
|
||||||
sdcard_app_send_op_cond(1, 0);
|
sdcard_app_send_op_cond(1, 0);
|
||||||
if (sdcard_response[3] & 0x80000000) {
|
if (sdcard_response[3] & 0x80000000) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
busy_wait(1);
|
busy_wait(10);
|
||||||
timeout--;
|
|
||||||
}
|
}
|
||||||
if (timeout == 0)
|
if (timeout == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue