2017-10-20 13:26:47 +08:00
|
|
|
|
/*
|
|
|
|
|
* File : mnt.c
|
|
|
|
|
* COPYRIGHT (C) 2008 - 2016, RT-Thread Development Team
|
|
|
|
|
*
|
|
|
|
|
* Change Logs:
|
|
|
|
|
* Date Author Notes
|
|
|
|
|
* 2017<EFBFBD><EFBFBD>4<EFBFBD><EFBFBD>3<EFBFBD><EFBFBD> Urey the first version
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <rtthread.h>
|
|
|
|
|
#include <rtdevice.h>
|
|
|
|
|
|
|
|
|
|
#ifdef RT_USING_DFS
|
|
|
|
|
#include <dfs_fs.h>
|
|
|
|
|
|
|
|
|
|
int mnt_init(void)
|
|
|
|
|
{
|
2017-11-30 23:56:52 +08:00
|
|
|
|
dfs_init();
|
|
|
|
|
|
2017-10-20 13:26:47 +08:00
|
|
|
|
#ifdef RT_USING_DFS_WINSHAREDIR
|
|
|
|
|
dfs_win32_init();
|
|
|
|
|
rt_win_sharedir_init("wshare");
|
|
|
|
|
|
|
|
|
|
if (dfs_mount("wshare", "/", "wdir", 0, 0) == 0)
|
|
|
|
|
{
|
|
|
|
|
rt_kprintf("File System on root initialized!\n");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
rt_kprintf("File System on root initialization failed!\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (dfs_mount("sd0", "/sd", "elm", 0, 0) == 0)
|
|
|
|
|
{
|
|
|
|
|
rt_kprintf("File System on sd initialized!\n");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
rt_kprintf("File System on sd initialization failed!\n");
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
if (dfs_mount("sd0", "/", "elm", 0, 0) == 0)
|
|
|
|
|
{
|
|
|
|
|
rt_kprintf("File System on sd initialized!\n");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
rt_kprintf("File System on sd initialization failed!\n");
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2017-11-30 23:56:52 +08:00
|
|
|
|
return 0;
|
2017-10-20 13:26:47 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|