Skip to content

Commit 2ac8bc8

Browse files
committed
【修改】函数和宏命名,移除添加的文件
1 parent 74b3bb0 commit 2ac8bc8

File tree

5 files changed

+21
-57
lines changed

5 files changed

+21
-57
lines changed

bsp/stm32/stm32f407-atk-explorer/board/Kconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,12 @@ menu "Onboard Peripheral Drivers"
9292
depends on BSP_USING_SDCARD
9393
default 1000000
9494

95-
config BSP_USING_NOR_MTD_FS
95+
config BSP_USING_SPI_FLASH_LITTLEFS
9696
bool "Enable LITTLEFS"
9797
select RT_USING_DFS
98+
select RT_USING_DFS_ROMFS
9899
select RT_USING_MTD_NOR
99-
select BSP_USING_ON_CHIP_FLASH
100-
select BSP_USING_SPI_FLASH
100+
select BSP_USING_SPI_FLASH
101101
select BSP_USING_FS
102102
select RT_USING_SYSTEM_WORKQUEUE
103103
default n

bsp/stm32/stm32f407-atk-explorer/board/SConscript

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ if GetDepend(['BSP_USING_SPI_FLASH']):
2020

2121
if GetDepend(['BSP_USING_FS']):
2222
src += Glob('ports/drv_filesystem.c')
23-
src += Glob('ports/dfs_romfs.h')
2423

2524
if GetDepend(['BSP_USING_SRAM']):
2625
src += Glob('ports/drv_sram.c')

bsp/stm32/stm32f407-atk-explorer/board/ports/dfs_romfs.h

Lines changed: 0 additions & 31 deletions
This file was deleted.

bsp/stm32/stm32f407-atk-explorer/board/ports/drv_filesystem.c

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
#include <dfs_posix.h>
1919
#include <fal.h>
2020

21-
#define BSP_USING_NOR_MTD_FS
22-
2321
#if DFS_FILESYSTEMS_MAX < 4
2422
#error "Please define DFS_FILESYSTEMS_MAX more than 4"
2523
#endif
@@ -78,11 +76,11 @@ static int onboard_sdcard_mount(void)
7876
}
7977
#endif
8078

81-
#ifdef BSP_USING_NOR_MTD_FS
79+
#ifdef BSP_USING_SPI_FLASH_LITTLEFS
8280

8381
#define FS_PARTITION_NAME "filesystem"
8482

85-
static void mtd_mount(void *parameter)
83+
static void spiflash_mount(void *parameter)
8684
{
8785
struct rt_device *mtd_dev = RT_NULL;
8886
fal_init();
@@ -98,36 +96,36 @@ static void mtd_mount(void *parameter)
9896
{
9997
if (dfs_mount(FS_PARTITION_NAME, "/flash", "lfs", 0, 0) == RT_EOK)
10098
{
101-
LOG_I("mtd nor flash mount to '/flash'");
99+
LOG_I("spi flash mount to '/flash'");
102100
break;
103101
}
104102
else
105103
{
106-
LOG_W("mtd nor flash mount to '/flash' failed!");
104+
LOG_W("spi flash mount to '/flash' failed!");
107105
}
108106
}
109107
}
110108
}
111109

112-
static int onboard_mtd_mount(void)
110+
static int onboard_spiflash_mount(void)
113111
{
114112
rt_thread_t tid;
115113

116114
if (dfs_mount(FS_PARTITION_NAME, "/flash", "lfs", 0, 0) == RT_EOK)
117115
{
118-
LOG_I("mtd nor flash mount to '/flash'");
116+
LOG_I("spi flash mount to '/flash'");
119117
}
120118
else
121119
{
122-
tid = rt_thread_create("mtd_mount", mtd_mount, RT_NULL,
120+
tid = rt_thread_create("spiflash_mount", spiflash_mount, RT_NULL,
123121
1024, RT_THREAD_PRIORITY_MAX - 3, 20);
124122
if (tid != RT_NULL)
125123
{
126124
rt_thread_startup(tid);
127125
}
128126
else
129127
{
130-
LOG_E("create mtd_mount thread err!");
128+
LOG_E("create spiflash_mount thread err!");
131129
}
132130
}
133131

@@ -141,11 +139,10 @@ static const struct romfs_dirent _romfs_root[] =
141139
#ifdef BSP_USING_SDCARD
142140
{ROMFS_DIRENT_DIR, "sdcard", RT_NULL, 0},
143141
#endif
144-
#ifdef BSP_USING_NOR_MTD_FS
142+
143+
#ifdef BSP_USING_SPI_FLASH_LITTLEFS
145144
{ROMFS_DIRENT_DIR, "flash", RT_NULL, 0},
146145
#endif
147-
148-
// {ROMFS_DIRENT_DIR, "flash", RT_NULL, 0},
149146
};
150147

151148
const struct romfs_dirent romfs_root =
@@ -163,8 +160,8 @@ static int filesystem_mount(void)
163160
onboard_sdcard_mount();
164161
#endif
165162

166-
#ifdef BSP_USING_NOR_MTD_FS
167-
onboard_mtd_mount();
163+
#ifdef BSP_USING_SPI_FLASH_LITTLEFS
164+
onboard_spiflash_mount();
168165
#endif
169166

170167
return RT_EOK;

bsp/stm32/stm32f407-atk-explorer/board/ports/fal_cfg.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,24 @@
1414
#include <rtthread.h>
1515
#include <board.h>
1616

17+
#ifdef BSP_USING_SPI_FLASH_LITTLEFS
18+
extern struct fal_flash_dev nor_flash0;
19+
#else
1720
#define FLASH_SIZE_GRANULARITY_16K (4 * 16 * 1024)
1821
#define FLASH_SIZE_GRANULARITY_64K (64 * 1024)
1922
#define FLASH_SIZE_GRANULARITY_128K (7 * 128 * 1024)
20-
2123
#define STM32_FLASH_START_ADRESS_16K STM32_FLASH_START_ADRESS
2224
#define STM32_FLASH_START_ADRESS_64K (STM32_FLASH_START_ADRESS_16K + FLASH_SIZE_GRANULARITY_16K)
2325
#define STM32_FLASH_START_ADRESS_128K (STM32_FLASH_START_ADRESS_64K + FLASH_SIZE_GRANULARITY_64K)
2426

25-
#ifdef BSP_USING_NOR_MTD_FS
26-
extern struct fal_flash_dev nor_flash0;
27-
#else
2827
extern const struct fal_flash_dev stm32_onchip_flash_16k;
2928
extern const struct fal_flash_dev stm32_onchip_flash_64k;
3029
extern const struct fal_flash_dev stm32_onchip_flash_128k;
3130
#endif
3231

3332

3433
/* flash device table */
35-
#ifdef BSP_USING_NOR_MTD_FS
34+
#ifdef BSP_USING_SPI_FLASH_LITTLEFS
3635
#define FAL_FLASH_DEV_TABLE \
3736
{ \
3837
&nor_flash0, \
@@ -50,10 +49,10 @@ extern const struct fal_flash_dev stm32_onchip_flash_128k;
5049
#ifdef FAL_PART_HAS_TABLE_CFG
5150

5251
/* partition table */
53-
#ifdef BSP_USING_NOR_MTD_FS
52+
#ifdef BSP_USING_SPI_FLASH_LITTLEFS
5453
#define FAL_PART_TABLE \
5554
{ \
56-
{FAL_PART_MAGIC_WROD, "filesystem",FAL_USING_NOR_FLASH_DEV_NAME, 0 , 1024 * 1024, 0}, \
55+
{FAL_PART_MAGIC_WROD, "filesystem",FAL_USING_NOR_FLASH_DEV_NAME, 0 , 16 * 1024 * 1024, 0}, \
5756
}
5857
#else
5958
#define FAL_PART_TABLE \

0 commit comments

Comments
 (0)