From a28828a6f4e6c45038274f69502b746b810062c2 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Sun, 10 Apr 2022 21:47:39 +0200 Subject: [PATCH] fatfs: re-enable TRIM support for SPI mode Previously this didn't work because MMC_ERASE implementation for SPI didn't wait for the busy status indication. --- components/fatfs/diskio/diskio_sdmmc.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/components/fatfs/diskio/diskio_sdmmc.c b/components/fatfs/diskio/diskio_sdmmc.c index 19f6d5698c..97578c9f0e 100644 --- a/components/fatfs/diskio/diskio_sdmmc.c +++ b/components/fatfs/diskio/diskio_sdmmc.c @@ -101,13 +101,6 @@ DRESULT ff_sdmmc_ioctl (BYTE pdrv, BYTE cmd, void* buff) return RES_ERROR; #if FF_USE_TRIM case CTRL_TRIM: - /* - * limitation with sector erase when used in SDSPI mode - * hence return if host is SPI. - */ - if ((card->host.flags & SDMMC_HOST_FLAG_SPI) != 0) { - return RES_ERROR; - } return ff_sdmmc_trim (pdrv, *((DWORD*)buff), //start_sector (*((DWORD*)buff + 1) - *((DWORD*)buff) + 1)); //sector_count #endif //FF_USE_TRIM