Skip to content

Commit

Permalink
tests/pkg/fatfs_vfs: add SDMMC support
Browse files Browse the repository at this point in the history
  • Loading branch information
gschorcht committed Dec 24, 2023
1 parent 6c28abc commit c345b81
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions tests/pkg/fatfs_vfs/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,9 @@ static vfs_mount_t _test_vfs_mount = {
.private_data = (void *)&fatfs,
};

#if defined(MODULE_MTD_NATIVE) || defined(MODULE_MTD_MCI)
#if defined(MODULE_MTD_NATIVE) || defined(MODULE_MTD_MCI) || defined(MODULE_MTD_SDMMC)
/* mtd devices are provided in the board's board_init.c*/
#endif

#if defined(MODULE_MTD_SDCARD)
#elif defined(MODULE_MTD_SDCARD)
#define SDCARD_SPI_NUM ARRAY_SIZE(sdcard_spi_params)
extern sdcard_spi_t sdcard_spi_devs[SDCARD_SPI_NUM];
mtd_sdcard_t mtd_sdcard_devs[SDCARD_SPI_NUM];
Expand Down Expand Up @@ -398,20 +396,18 @@ static void test_libc(void)

int main(void)
{
#if MODULE_MTD_SDCARD
#if defined(MODULE_MTD_NATIVE) || defined(MODULE_MTD_MCI)
fatfs.dev = mtd_dev_get(0);
#elif defined(MODULE_MTD_SDMMC)
fatfs.dev = mtd_sdmmc_dev0;
#elif defined(MODULE_MTD_SDCARD)
for(unsigned int i = 0; i < SDCARD_SPI_NUM; i++){

Check warning on line 404 in tests/pkg/fatfs_vfs/main.c

View workflow job for this annotation

GitHub Actions / static-tests

keyword 'for' not followed by a single space
mtd_sdcard_devs[i].base.driver = &mtd_sdcard_driver;
mtd_sdcard_devs[i].sd_card = &sdcard_spi_devs[i];
mtd_sdcard_devs[i].params = &sdcard_spi_params[i];
mtd_init(&mtd_sdcard_devs[i].base);
}
#endif

#if defined(MODULE_MTD_NATIVE) || defined(MODULE_MTD_MCI)
fatfs.dev = mtd_dev_get(0);
#endif

#if defined(MODULE_MTD_SDCARD)
fatfs.dev = mtd_sdcard;
#endif

Expand Down

0 comments on commit c345b81

Please sign in to comment.