mnt.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * File : mnt.c
  3. * COPYRIGHT (C) 2008 - 2016, RT-Thread Development Team
  4. *
  5. * Change Logs:
  6. * Date Author Notes
  7. * 2017Äê4ÔÂ3ÈÕ Urey the first version
  8. */
  9. #include <rtthread.h>
  10. #include <rtdevice.h>
  11. #ifdef RT_USING_DFS
  12. #include <dfs_fs.h>
  13. int mnt_init(void)
  14. {
  15. dfs_init();
  16. #ifdef RT_USING_DFS_WINSHAREDIR
  17. extern int dfs_win32_init(void);
  18. extern rt_err_t rt_win_sharedir_init(const char *name);
  19. dfs_win32_init();
  20. rt_win_sharedir_init("wshare");
  21. if (dfs_mount("wshare", "/", "wdir", 0, 0) == 0)
  22. {
  23. rt_kprintf("File System on root initialized!\n");
  24. }
  25. else
  26. {
  27. rt_kprintf("File System on root initialization failed!\n");
  28. }
  29. if (dfs_mount("sd0", "/sd", "elm", 0, 0) == 0)
  30. {
  31. rt_kprintf("File System on sd initialized!\n");
  32. }
  33. else
  34. {
  35. rt_kprintf("File System on sd initialization failed!\n");
  36. }
  37. #else
  38. if (dfs_mount("sd0", "/", "elm", 0, 0) == 0)
  39. {
  40. rt_kprintf("File System on sd initialized!\n");
  41. }
  42. else
  43. {
  44. rt_kprintf("File System on sd initialization failed!\n");
  45. }
  46. #endif
  47. return 0;
  48. }
  49. #endif