SDCARD: First sector always written twice if multiple sectors are updated

This commit is contained in:
Me No Dev 2020-11-06 22:20:20 +02:00 committed by GitHub
parent ad07d36932
commit 486a4c66c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -607,8 +607,9 @@ DRESULT ff_sd_write(uint8_t pdrv, const uint8_t* buffer, DWORD sector, UINT coun
if (count > 1) { if (count > 1) {
res = sdWriteSectors(pdrv, (const char*)buffer, sector, count) ? RES_OK : RES_ERROR; res = sdWriteSectors(pdrv, (const char*)buffer, sector, count) ? RES_OK : RES_ERROR;
} else {
res = sdWriteSector(pdrv, (const char*)buffer, sector) ? RES_OK : RES_ERROR;
} }
res = sdWriteSector(pdrv, (const char*)buffer, sector) ? RES_OK : RES_ERROR;
return res; return res;
} }