mirror of https://github.com/RT-Thread/rt-thread
[stm32f407-explorer][fs] 优化文件系统选项配置
This commit is contained in:
parent
10695d6a90
commit
2f7c294d97
|
@ -134,40 +134,29 @@ menu "Onboard Peripheral Drivers"
|
||||||
select BSP_USING_I2C1
|
select BSP_USING_I2C1
|
||||||
select PKG_USING_MPU6XXX
|
select PKG_USING_MPU6XXX
|
||||||
|
|
||||||
menu "Enable File System"
|
menuconfig BSP_USING_FS
|
||||||
config BSP_USING_FS
|
bool "Enable File System"
|
||||||
bool
|
select RT_USING_DFS
|
||||||
default n
|
select RT_USING_DFS_ROMFS
|
||||||
|
default n
|
||||||
|
|
||||||
config BSP_USING_SDCARD_FATFS
|
if BSP_USING_FS
|
||||||
bool "Enable SDCARD (FATFS)"
|
config BSP_USING_SDCARD_FATFS
|
||||||
select BSP_USING_SDIO
|
bool "Enable SDCARD (FATFS)"
|
||||||
select RT_USING_DFS
|
select BSP_USING_SDIO
|
||||||
select RT_USING_DFS_ELMFAT
|
select RT_USING_DFS_ELMFAT
|
||||||
select RT_USING_DFS_ROMFS
|
default n
|
||||||
select BSP_USING_FS
|
|
||||||
default n
|
|
||||||
|
|
||||||
config SDIO_MAX_FREQ
|
config BSP_USING_SPI_FLASH_LITTLEFS
|
||||||
int "sdio max freq"
|
bool "Enable SPI-FLASH (LittleFS)"
|
||||||
range 0 24000000
|
select RT_USING_MTD_NOR
|
||||||
depends on BSP_USING_SDCARD
|
select BSP_USING_SPI_FLASH
|
||||||
default 1000000
|
select RT_USING_FAL
|
||||||
|
select FAL_USING_AUTO_INIT
|
||||||
config BSP_USING_SPI_FLASH_LITTLEFS
|
select FAL_PART_HAS_TABLE_CFG
|
||||||
bool "Enable SPI-FLASH (LittleFS)"
|
select PKG_USING_LITTLEFS
|
||||||
select RT_USING_DFS
|
default n
|
||||||
select RT_USING_DFS_ROMFS
|
endif
|
||||||
select RT_USING_MTD_NOR
|
|
||||||
select BSP_USING_SPI_FLASH
|
|
||||||
select BSP_USING_FS
|
|
||||||
select RT_USING_FAL
|
|
||||||
select FAL_USING_AUTO_INIT
|
|
||||||
select FAL_PART_HAS_TABLE_CFG
|
|
||||||
select PKG_USING_LITTLEFS
|
|
||||||
default n
|
|
||||||
|
|
||||||
endmenu
|
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
|
||||||
|
@ -467,6 +456,12 @@ menu "On-chip Peripheral Drivers"
|
||||||
select RT_USING_DFS
|
select RT_USING_DFS
|
||||||
default n
|
default n
|
||||||
|
|
||||||
|
config SDIO_MAX_FREQ
|
||||||
|
int "sdio max freq"
|
||||||
|
range 0 24000000
|
||||||
|
depends on BSP_USING_SDIO
|
||||||
|
default 1000000
|
||||||
|
|
||||||
config BSP_USING_USBD
|
config BSP_USING_USBD
|
||||||
bool "Enable USB Device"
|
bool "Enable USB Device"
|
||||||
select RT_USING_USB_DEVICE
|
select RT_USING_USB_DEVICE
|
||||||
|
|
|
@ -27,7 +27,8 @@ if GetDepend(['BSP_USING_SPI_FLASH']):
|
||||||
if GetDepend(['BSP_USING_FS']):
|
if GetDepend(['BSP_USING_FS']):
|
||||||
src += Glob('ports/drv_filesystem.c')
|
src += Glob('ports/drv_filesystem.c')
|
||||||
if GetDepend(['BSP_USING_SPI_FLASH_LITTLEFS']):
|
if GetDepend(['BSP_USING_SPI_FLASH_LITTLEFS']):
|
||||||
src += Glob('ports/fal_spi_flash_sfud_port.c')
|
src += Glob('ports/fal/fal_spi_flash_sfud_port.c')
|
||||||
|
path += [cwd + '/ports/fal']
|
||||||
|
|
||||||
if GetDepend(['BSP_USING_SRAM']):
|
if GetDepend(['BSP_USING_SRAM']):
|
||||||
src += Glob('ports/drv_sram.c')
|
src += Glob('ports/drv_sram.c')
|
||||||
|
|
|
@ -11,15 +11,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <rtthread.h>
|
#include <rtthread.h>
|
||||||
|
|
||||||
#ifdef BSP_USING_FS
|
|
||||||
#include <dfs_romfs.h>
|
#include <dfs_romfs.h>
|
||||||
#include <dfs_fs.h>
|
#include <dfs_fs.h>
|
||||||
#include <dfs_file.h>
|
#include <dfs_file.h>
|
||||||
#include <unistd.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/statfs.h>
|
|
||||||
|
|
||||||
#if DFS_FILESYSTEMS_MAX < 4
|
#if DFS_FILESYSTEMS_MAX < 4
|
||||||
#error "Please define DFS_FILESYSTEMS_MAX more than 4"
|
#error "Please define DFS_FILESYSTEMS_MAX more than 4"
|
||||||
|
@ -46,7 +40,7 @@ static int onboard_sdcard_mount(void)
|
||||||
|
|
||||||
return RT_EOK;
|
return RT_EOK;
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* BSP_USING_SDCARD_FATFS */
|
||||||
|
|
||||||
#ifdef BSP_USING_SPI_FLASH_LITTLEFS
|
#ifdef BSP_USING_SPI_FLASH_LITTLEFS
|
||||||
#include <fal.h>
|
#include <fal.h>
|
||||||
|
@ -83,7 +77,7 @@ static int onboard_spiflash_mount(void)
|
||||||
|
|
||||||
return RT_EOK;
|
return RT_EOK;
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* BSP_USING_SPI_FLASH_LITTLEFS */
|
||||||
|
|
||||||
static const struct romfs_dirent _romfs_root[] =
|
static const struct romfs_dirent _romfs_root[] =
|
||||||
{
|
{
|
||||||
|
@ -96,7 +90,7 @@ static const struct romfs_dirent _romfs_root[] =
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct romfs_dirent romfs_root =
|
static const struct romfs_dirent romfs_root =
|
||||||
{
|
{
|
||||||
ROMFS_DIRENT_DIR, "/", (rt_uint8_t *)_romfs_root, sizeof(_romfs_root) / sizeof(_romfs_root[0])
|
ROMFS_DIRENT_DIR, "/", (rt_uint8_t *)_romfs_root, sizeof(_romfs_root) / sizeof(_romfs_root[0])
|
||||||
};
|
};
|
||||||
|
@ -118,5 +112,3 @@ static int filesystem_mount(void)
|
||||||
return RT_EOK;
|
return RT_EOK;
|
||||||
}
|
}
|
||||||
INIT_APP_EXPORT(filesystem_mount);
|
INIT_APP_EXPORT(filesystem_mount);
|
||||||
|
|
||||||
#endif /* BSP_USING_FS */
|
|
||||||
|
|
Loading…
Reference in New Issue