fix multi-sector SD_Read

This commit is contained in:
marqs 2026-03-07 23:47:28 +02:00
parent c7fa9527fa
commit eee3950f2e

View File

@ -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;
}