Merge branch 'fix/fatfs_sdmmc_triming_v5.1' into 'release/v5.1'

fix(storage/fatfs): check whether sdcard supports trimming (v5.1)

See merge request espressif/esp-idf!28336
This commit is contained in:
Jiang Jiang Jian 2024-03-14 13:47:00 +08:00
commit 5059908d08

View File

@ -105,6 +105,9 @@ DRESULT ff_sdmmc_ioctl (BYTE pdrv, BYTE cmd, void* buff)
return RES_ERROR;
#if FF_USE_TRIM
case CTRL_TRIM:
if (sdmmc_can_trim(card) != ESP_OK) {
return RES_PARERR;
}
return ff_sdmmc_trim (pdrv, *((DWORD*)buff), //start_sector
(*((DWORD*)buff + 1) - *((DWORD*)buff) + 1)); //sector_count
#endif //FF_USE_TRIM