/* * 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 #include #include #include #include #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 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);