mnt.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2017-04-03 Urey the first version
  9. */
  10. #include <rtthread.h>
  11. #include <rtdevice.h>
  12. #ifdef RT_USING_DFS
  13. #include <dfs_fs.h>
  14. int mnt_init(void)
  15. {
  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. INIT_COMPONENT_EXPORT(mnt_init);
  50. #endif