Browse Source

update ff.c/h

mazhiyuan 3 years ago
parent
commit
92ee14ff7a
2 changed files with 16 additions and 0 deletions
  1. 15 0
      components/dfs/filesystems/elmfat/ff.c
  2. 1 0
      components/dfs/filesystems/elmfat/ff.h

+ 15 - 0
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
+

+ 1 - 0
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