Skip to content

Commit

Permalink
Merge branch 'fix/fatfs_sdmmc_triming_v5.1' into 'release/v5.1'
Browse files Browse the repository at this point in the history
fix(storage/fatfs): check whether sdcard supports trimming (v5.1)

See merge request espressif/esp-idf!28336
  • Loading branch information
jack0c committed Mar 14, 2024
2 parents 2d90015 + e5742d6 commit 5059908
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions components/fatfs/diskio/diskio_sdmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5059908

Please sign in to comment.