summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDingDing <[email protected]>2023-06-20 12:22:52 +0800
committerGitHub <[email protected]>2023-06-20 00:22:52 -0400
commit3e4797c63c43384825d63166966289bb60b6be78 (patch)
treef9401eaa91708a05c6ceb0fc0e37320192fe5e29
parent8a8ecbc25dafa250bf3b3cee7331e5ca5b068d42 (diff)
[stm32][pandora] fix the static conflict error in ROMFS
#### 为什么提交这份PR (why to submit this PR) 原版编译报错:Static declaration of 'romfs_root' follows non-static declaration in dfs_romfs.h 原因为:在`board/ports/drv_filesystem.c`71行用`static`定义了常量`romfs_root`,而在`rt-thread/components/dfs/dfs_v1/filesystems/romfs/dfs_romfs.h`29行,有它的外部引用: ``` extern const struct romfs_dirent romfs_root; ``` Original compilation error: Static declaration of 'romfs_ root' follows non-static declaration in dfs_romfs. h The reason is: in 'board/ports/drv_filesystem.c' line 71 use `static` define `romfs_root`, while in `rt-thread/components/dfs/dfs_v1/filesystems/romfs/dfs_romfs.h` line 29, with its external reference: ``` extern const struct romfs_dirent romfs_root; ``` #### 你的解决方案是什么 (what is your solution) 在`drv_filesystem.c`中,不可以用static修饰这个常量,故去掉`static`关键字。 In `board/ports/drv_filesystem.c`, it is not allowed to define this constant with static, so the `static` keyword must be removed. #### 在什么测试环境下测试通过 (what is the test environment) 正点原子潘多拉开发板 stm32l475-atk-pandora
-rw-r--r--bsp/stm32/stm32l475-atk-pandora/board/ports/drv_filesystem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bsp/stm32/stm32l475-atk-pandora/board/ports/drv_filesystem.c b/bsp/stm32/stm32l475-atk-pandora/board/ports/drv_filesystem.c
index a15b84052c..b368b11aa8 100644
--- a/bsp/stm32/stm32l475-atk-pandora/board/ports/drv_filesystem.c
+++ b/bsp/stm32/stm32l475-atk-pandora/board/ports/drv_filesystem.c
@@ -68,7 +68,7 @@ static const struct romfs_dirent _romfs_root[] =
#endif
};
-static const struct romfs_dirent romfs_root =
+const struct romfs_dirent romfs_root =
{
ROMFS_DIRENT_DIR, "/", (rt_uint8_t *)_romfs_root, sizeof(_romfs_root) / sizeof(_romfs_root[0])
};