summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormazhiyuan <[email protected]>2021-10-25 14:41:50 +0800
committermazhiyuan <[email protected]>2021-10-25 14:41:50 +0800
commit92ee14ff7ab344afdf7a37759e87a1a562945946 (patch)
treeafefeb151c5acf18f7b118d91d1310de33b3e0a1
parent41af94494943d4fab901ea946dd278e32bcaa900 (diff)
update ff.c/h
-rw-r--r--components/dfs/filesystems/elmfat/ff.c15
-rw-r--r--components/dfs/filesystems/elmfat/ff.h1
2 files changed, 16 insertions, 0 deletions
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 <rtthread.h>
+#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 <rtthread.h>
#include "ffconf.h" /* FatFs configuration options */
#if FF_DEFINED != FFCONF_DEF