summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2019-09-05 08:04:42 +0800
committerGitHub <[email protected]>2019-09-05 08:04:42 +0800
commit9ce84eddc1cbf03aed98c0fc923ee9fd2196f69a (patch)
tree9e56fce6a0079cd41ed634d1762dd318e8aab73f
parent30c43a098a529f37c95b6f02f515b5a783e928f6 (diff)
parent1d44368b277879acf9a13925d6a434142ebb1ab8 (diff)
Merge pull request #3039 from tyustli/dfs
[bsp] [stm32] port to dfs
-rw-r--r--bsp/stm32/stm32f429-atk-apollo/applications/SConscript3
-rw-r--r--bsp/stm32/stm32f429-atk-apollo/applications/mnt.c20
2 files changed, 23 insertions, 0 deletions
diff --git a/bsp/stm32/stm32f429-atk-apollo/applications/SConscript b/bsp/stm32/stm32f429-atk-apollo/applications/SConscript
index 6f66f7ab73..2b1cc698c5 100644
--- a/bsp/stm32/stm32f429-atk-apollo/applications/SConscript
+++ b/bsp/stm32/stm32f429-atk-apollo/applications/SConscript
@@ -7,6 +7,9 @@ src = Split("""
main.c
""")
+if GetDepend(['RT_USING_DFS']):
+ src += ['mnt.c']
+
group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH)
Return('group')
diff --git a/bsp/stm32/stm32f429-atk-apollo/applications/mnt.c b/bsp/stm32/stm32f429-atk-apollo/applications/mnt.c
new file mode 100644
index 0000000000..c8e0890263
--- /dev/null
+++ b/bsp/stm32/stm32f429-atk-apollo/applications/mnt.c
@@ -0,0 +1,20 @@
+#include <rtthread.h>
+
+#ifdef RT_USING_DFS
+#include <dfs_fs.h>
+
+int mnt_init(void)
+{
+ if (dfs_mount("W25Q256", "/", "elm", 0, 0) == 0)
+ {
+ rt_kprintf("W25Q256 mount successful!\n");
+ }
+ else
+ {
+ rt_kprintf("W25Q256 mount failed!\n");
+ }
+
+ return 0;
+}
+INIT_ENV_EXPORT(mnt_init);
+#endif