diff --git a/components/dfs/filesystems/elmfat/ff.c b/components/dfs/filesystems/elmfat/ff.c index f80f405377..815c3d2b83 100644 --- a/components/dfs/filesystems/elmfat/ff.c +++ b/components/dfs/filesystems/elmfat/ff.c @@ -6997,3 +6997,18 @@ FRESULT f_setcp ( } #endif /* FF_CODE_PAGE == 0 */ +#include +#if FF_VOLUMES > 1 +int elm_get_vol(FATFS *fat) +{ + int vol; + + for (vol = 0; vol < FF_VOLUMES; vol ++) + { + if (FatFs[vol] == fat) return vol; + } + + return -1; +} +#endif + diff --git a/components/dfs/filesystems/elmfat/ff.h b/components/dfs/filesystems/elmfat/ff.h index 868ebf95ed..7db1c4d4a2 100644 --- a/components/dfs/filesystems/elmfat/ff.h +++ b/components/dfs/filesystems/elmfat/ff.h @@ -26,6 +26,7 @@ extern "C" { #endif +#include #include "ffconf.h" /* FatFs configuration options */ #if FF_DEFINED != FFCONF_DEF