mnt.c 1.0 KB
Newer Older
Y
yygg_you 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/*
 * File      : mnt.c
 * COPYRIGHT (C) 2008 - 2016, RT-Thread Development Team
 *
 * Change Logs:
 * Date           Author       Notes
 * 201743     Urey         the first version
 */

#include <rtthread.h>
#include <rtdevice.h>

#ifdef RT_USING_DFS
#include <dfs_fs.h>

int mnt_init(void)
{
B
bernard 已提交
18 19
    dfs_init();

Y
yygg_you 已提交
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
#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

B
bernard 已提交
52
    return 0;
Y
yygg_you 已提交
53 54 55
}

#endif