提交 2f7c294d 编写于 作者: mysterywolf's avatar mysterywolf 提交者: guo

[stm32f407-explorer][fs] 优化文件系统选项配置

上级 10695d6a
......@@ -134,40 +134,29 @@ menu "Onboard Peripheral Drivers"
select BSP_USING_I2C1
select PKG_USING_MPU6XXX
menu "Enable File System"
config BSP_USING_FS
bool
default n
config BSP_USING_SDCARD_FATFS
bool "Enable SDCARD (FATFS)"
select BSP_USING_SDIO
select RT_USING_DFS
select RT_USING_DFS_ELMFAT
select RT_USING_DFS_ROMFS
select BSP_USING_FS
default n
menuconfig BSP_USING_FS
bool "Enable File System"
select RT_USING_DFS
select RT_USING_DFS_ROMFS
default n
config SDIO_MAX_FREQ
int "sdio max freq"
range 0 24000000
depends on BSP_USING_SDCARD
default 1000000
config BSP_USING_SPI_FLASH_LITTLEFS
bool "Enable SPI-FLASH (LittleFS)"
select RT_USING_DFS
select RT_USING_DFS_ROMFS
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
if BSP_USING_FS
config BSP_USING_SDCARD_FATFS
bool "Enable SDCARD (FATFS)"
select BSP_USING_SDIO
select RT_USING_DFS_ELMFAT
default n
endmenu
config BSP_USING_SPI_FLASH_LITTLEFS
bool "Enable SPI-FLASH (LittleFS)"
select RT_USING_MTD_NOR
select BSP_USING_SPI_FLASH
select RT_USING_FAL
select FAL_USING_AUTO_INIT
select FAL_PART_HAS_TABLE_CFG
select PKG_USING_LITTLEFS
default n
endif
endmenu
......@@ -467,6 +456,12 @@ menu "On-chip Peripheral Drivers"
select RT_USING_DFS
default n
config SDIO_MAX_FREQ
int "sdio max freq"
range 0 24000000
depends on BSP_USING_SDIO
default 1000000
config BSP_USING_USBD
bool "Enable USB Device"
select RT_USING_USB_DEVICE
......
......@@ -27,7 +27,8 @@ if GetDepend(['BSP_USING_SPI_FLASH']):
if GetDepend(['BSP_USING_FS']):
src += Glob('ports/drv_filesystem.c')
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']):
src += Glob('ports/drv_sram.c')
......
......@@ -11,15 +11,9 @@
*/
#include <rtthread.h>
#ifdef BSP_USING_FS
#include <dfs_romfs.h>
#include <dfs_fs.h>
#include <dfs_file.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/statfs.h>
#if DFS_FILESYSTEMS_MAX < 4
#error "Please define DFS_FILESYSTEMS_MAX more than 4"
......@@ -46,7 +40,7 @@ static int onboard_sdcard_mount(void)
return RT_EOK;
}
#endif
#endif /* BSP_USING_SDCARD_FATFS */
#ifdef BSP_USING_SPI_FLASH_LITTLEFS
#include <fal.h>
......@@ -83,7 +77,7 @@ static int onboard_spiflash_mount(void)
return RT_EOK;
}
#endif
#endif /* BSP_USING_SPI_FLASH_LITTLEFS */
static const struct romfs_dirent _romfs_root[] =
{
......@@ -96,7 +90,7 @@ static const struct romfs_dirent _romfs_root[] =
#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])
};
......@@ -118,5 +112,3 @@ static int filesystem_mount(void)
return RT_EOK;
}
INIT_APP_EXPORT(filesystem_mount);
#endif /* BSP_USING_FS */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册