summaryrefslogtreecommitdiff
path: root/bsp/lpc54114-lite/applications/mnt.c
blob: f67c5c21ea264fc11b694529adb1da1b9885bb02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 */

#include <rtthread.h>

#if defined(RT_USING_DFS)
#include <dfs_file.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/statfs.h>
#endif

#define BSP_FLASH_MOUNT_PATH  "/mnt/flash"
#define BSP_SDCARD_MOUNT_PATH "/mnt/sd"

int mnt_init(void)
{
#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);
    }
#endif

#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);
    }
#endif

    return 0;
}
INIT_APP_EXPORT(mnt_init);