2018-12-05 11:44:53 +08:00
|
|
|
/*
|
2021-03-17 02:26:35 +08:00
|
|
|
* Copyright (c) 2006-2021, RT-Thread Development Team
|
2018-12-05 11:44:53 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <rtthread.h>
|
|
|
|
|
2018-12-05 19:04:47 +08:00
|
|
|
#if defined(RT_USING_DFS)
|
|
|
|
#include <dfs_file.h>
|
|
|
|
#include <dfs_posix.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define BSP_FLASH_MOUNT_PATH "/mnt/flash"
|
|
|
|
#define BSP_SDCARD_MOUNT_PATH "/mnt/sd"
|
|
|
|
|
2018-12-05 11:44:53 +08:00
|
|
|
int mnt_init(void)
|
|
|
|
{
|
2018-12-05 19:04:47 +08:00
|
|
|
#if defined(BSP_USING_SPIFLASH)
|
|
|
|
if(dfs_mount("flash0", BSP_FLASH_MOUNT_PATH, "elm", 0, 0) != 0)
|
|
|
|
{
|
|
|
|
rt_kprintf("spi flash mount '%s' failed.\n", BSP_FLASH_MOUNT_PATH);
|
|
|
|
}
|
2021-03-17 02:26:35 +08:00
|
|
|
#endif
|
|
|
|
|
2018-12-05 19:04:47 +08:00
|
|
|
#if defined(BSP_USING_SDCARD)
|
|
|
|
if(dfs_mount("sd0", BSP_SDCARD_MOUNT_PATH, "elm", 0, 0) != 0)
|
|
|
|
{
|
|
|
|
rt_kprintf("sdcard mount '%s' failed.\n", BSP_SDCARD_MOUNT_PATH);
|
|
|
|
}
|
2021-03-17 02:26:35 +08:00
|
|
|
#endif
|
2018-12-05 19:04:47 +08:00
|
|
|
|
2018-12-05 11:44:53 +08:00
|
|
|
return 0;
|
|
|
|
}
|
2021-03-17 02:26:35 +08:00
|
|
|
INIT_APP_EXPORT(mnt_init);
|