mirror of
https://github.com/marqs85/ossc
synced 2026-03-10 21:53:47 +03:00
fix multi-sector SD_Read
This commit is contained in:
parent
c7fa9527fa
commit
eee3950f2e
@ -68,11 +68,16 @@ DRESULT disk_read (
|
||||
)
|
||||
{
|
||||
SDRESULTS res;
|
||||
int i;
|
||||
|
||||
if (!sdcard_dev.mount)
|
||||
return STA_NOINIT;
|
||||
|
||||
res = SD_Read(&sdcard_dev, buff, sector, 0, count*SD_BLK_SIZE);
|
||||
for (i=0; i<count; i++) {
|
||||
res = SD_Read(&sdcard_dev, (void*)&buff[i*SD_BLK_SIZE], sector+i, 0, SD_BLK_SIZE);
|
||||
if (res != SD_OK)
|
||||
return RES_PARERR;
|
||||
}
|
||||
|
||||
return (res == SD_OK) ? RES_OK : RES_PARERR;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user