Compare commits
No commits in common. "0395cd19d4614dd71481bb7e308530fb37e4b85e" and "45564a77899746bdb79cb654f16160ebd0b1715c" have entirely different histories.
0395cd19d4
...
45564a7789
@ -739,7 +739,6 @@ DRESULT sdio_disk_write(const BYTE *buff, DWORD sector, UINT count)
|
|||||||
uint32_t buff_offset = 0;
|
uint32_t buff_offset = 0;
|
||||||
int ret;
|
int ret;
|
||||||
UINT count_backup = count;
|
UINT count_backup = count;
|
||||||
uint32_t retry_counter = 512;
|
|
||||||
|
|
||||||
if (sdio_check_write_protection())
|
if (sdio_check_write_protection())
|
||||||
return RES_WRPRT;
|
return RES_WRPRT;
|
||||||
@ -755,18 +754,10 @@ DRESULT sdio_disk_write(const BYTE *buff, DWORD sector, UINT count)
|
|||||||
return RES_ERROR;
|
return RES_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (1) {
|
while (status.statusstruct.READY_FOR_DATA != 1) {
|
||||||
ret = sdio_check_status_register_cmd13(card_info.rca, &status.value);
|
ret = sdio_check_status_register_cmd13(card_info.rca, &status.value);
|
||||||
if (ret)
|
if (ret)
|
||||||
return RES_ERROR;
|
return RES_ERROR;
|
||||||
|
|
||||||
if (status.statusstruct.CURRENT_STATE == CURRENT_STATE_TRAN)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (--retry_counter == 0)
|
|
||||||
return RES_ERROR;
|
|
||||||
|
|
||||||
sdio_wait_ms(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count > 1)
|
if (count > 1)
|
||||||
|
@ -59,17 +59,19 @@ static int create_controller_folder(void)
|
|||||||
char foldername[48];
|
char foldername[48];
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
FRESULT filesystem_result;
|
FRESULT filesystem_result;
|
||||||
FILINFO fno;
|
DIR folder;
|
||||||
|
|
||||||
get_controller_folder_path(foldername, sizeof(foldername));
|
get_controller_folder_path(foldername, sizeof(foldername));
|
||||||
|
|
||||||
/* Check if folder is present */
|
/* Check if folder is present */
|
||||||
filesystem_result = f_stat(foldername, &fno);
|
filesystem_result = f_opendir(&folder, foldername);
|
||||||
if (filesystem_result == FR_OK && fno.fattrib & AM_DIR) {
|
if (filesystem_result == FR_OK) {
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
f_closedir(&folder);
|
||||||
} else {
|
} else {
|
||||||
filesystem_result = f_mkdir(foldername);
|
filesystem_result = f_mkdir(foldername);
|
||||||
if (filesystem_result == FR_OK) {
|
if (filesystem_result == FR_OK) {
|
||||||
|
f_closedir(&folder);
|
||||||
ret = 1;
|
ret = 1;
|
||||||
} else {
|
} else {
|
||||||
ret = -1;
|
ret = -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user