Skip to content

Commit

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

See merge request espressif/esp-idf!28335
  • Loading branch information
jack0c committed Feb 21, 2024
2 parents db3aa57 + 871476a commit 001b8ff
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions components/fatfs/diskio/diskio_sdmmc.c
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 001b8ff

Please sign in to comment.