mnt.c 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. dfs_win32_init();
  18. rt_win_sharedir_init("wshare");
  19. if (dfs_mount("wshare", "/", "wdir", 0, 0) == 0)
  20. {
  21. rt_kprintf("File System on root initialized!\n");
  22. }
  23. else
  24. {
  25. rt_kprintf("File System on root initialization failed!\n");
  26. }
  27. if (dfs_mount("sd0", "/sd", "elm", 0, 0) == 0)
  28. {
  29. rt_kprintf("File System on sd initialized!\n");
  30. }
  31. else
  32. {
  33. rt_kprintf("File System on sd initialization failed!\n");
  34. }
  35. #else
  36. if (dfs_mount("sd0", "/", "elm", 0, 0) == 0)
  37. {
  38. rt_kprintf("File System on sd initialized!\n");
  39. }
  40. else
  41. {
  42. rt_kprintf("File System on sd initialization failed!\n");
  43. }
  44. #endif
  45. return 0;
  46. }
  47. #endif