mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
software/liblitesdcard: Check sdcard_wait_data_done in sdcard_switch/sdcard_app_send_scr since requesting a data read transfer.
This commit is contained in:
parent
04cb8e0e5e
commit
c071bb4ac7
1 changed files with 6 additions and 4 deletions
|
@ -218,9 +218,10 @@ int sdcard_switch(unsigned int mode, unsigned int group, unsigned int value) {
|
||||||
#endif
|
#endif
|
||||||
sdcore_block_length_write(64);
|
sdcore_block_length_write(64);
|
||||||
sdcore_block_count_write(1);
|
sdcore_block_count_write(1);
|
||||||
return sdcard_send_command(arg, 6,
|
while (sdcard_send_command(arg, 6,
|
||||||
(SDCARD_CTRL_DATA_TRANSFER_READ << 5) |
|
(SDCARD_CTRL_DATA_TRANSFER_READ << 5) |
|
||||||
SDCARD_CTRL_RESPONSE_SHORT);
|
SDCARD_CTRL_RESPONSE_SHORT) != SD_OK);
|
||||||
|
return sdcard_wait_data_done();
|
||||||
}
|
}
|
||||||
|
|
||||||
int sdcard_app_send_scr(void) {
|
int sdcard_app_send_scr(void) {
|
||||||
|
@ -229,9 +230,10 @@ int sdcard_app_send_scr(void) {
|
||||||
#endif
|
#endif
|
||||||
sdcore_block_length_write(8);
|
sdcore_block_length_write(8);
|
||||||
sdcore_block_count_write(1);
|
sdcore_block_count_write(1);
|
||||||
return sdcard_send_command(0, 51,
|
while (sdcard_send_command(0, 51,
|
||||||
(SDCARD_CTRL_DATA_TRANSFER_READ << 5) |
|
(SDCARD_CTRL_DATA_TRANSFER_READ << 5) |
|
||||||
SDCARD_CTRL_RESPONSE_SHORT);
|
SDCARD_CTRL_RESPONSE_SHORT) != SD_OK);
|
||||||
|
return sdcard_wait_data_done();
|
||||||
}
|
}
|
||||||
|
|
||||||
int sdcard_app_set_blocklen(unsigned int blocklen) {
|
int sdcard_app_set_blocklen(unsigned int blocklen) {
|
||||||
|
|
Loading…
Reference in a new issue