From 1d44368b277879acf9a13925d6a434142ebb1ab8 Mon Sep 17 00:00:00 2001 From: tyustli <1225613647@qq.com> Date: Wed, 4 Sep 2019 20:36:52 +0800 Subject: [PATCH] [bsp] [stm32] port to dfs --- .../applications/SConscript | 3 +++ .../stm32f429-atk-apollo/applications/mnt.c | 20 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 bsp/stm32/stm32f429-atk-apollo/applications/mnt.c 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 + +#ifdef RT_USING_DFS +#include + +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