rt-thread/bsp/nxp/mcxn/frdm-mcxn947/board/ports/drv_filesystem.c

48 lines
1010 B
C

/*
* Copyright (c) 2006-2024, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2018-12-14 balanceTWK add sdcard port file
* 2021-02-26 Meco Man fix a bug that cannot use fatfs in the main thread at starting up
*/
#include <rtthread.h>
#include <dfs_elm.h>
#include <dfs_fs.h>
#include <dfs_file.h>
#include <dfs_romfs.h>
#if DFS_FILESYSTEMS_MAX < 4
#error "Please define DFS_FILESYSTEMS_MAX more than 4"
#endif
#if DFS_FILESYSTEM_TYPES_MAX < 4
#error "Please define DFS_FILESYSTEM_TYPES_MAX more than 4"
#endif
#define DBG_TAG "app.filesystem"
#define DBG_LVL DBG_INFO
#include <rtdbg.h>
static int filesystem_mount(void)
{
#ifdef RT_USING_SDIO
rt_thread_mdelay(2000);
if (dfs_mount("sd", "/", "elm", 0, NULL) == 0)
{
rt_kprintf("sd mounted to /\n");
}
else
{
rt_kprintf("sd mount to / failed\n");
}
#endif
return RT_EOK;
}
INIT_APP_EXPORT(filesystem_mount);