From 9f24c1fedd1ff99bcda09a33be214897ca6b7dba Mon Sep 17 00:00:00 2001 From: KYzhang_X Date: Tue, 2 Aug 2022 10:57:40 +0800 Subject: [PATCH 1/4] revise .gitignore --- .gitignore | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 1a720f2c..0d0f4b78 100644 --- a/.gitignore +++ b/.gitignore @@ -24,12 +24,13 @@ .DS_Store board/**/build board/**/.settings -board/*/MDK-ARM/DebugConfig/ +board/*/KEIL/*/DebugConfig/ board/*/obj/ -board/*/MDK-ARM/Obj/ -board/*/MDK-ARM/RTE/ -board/*/MDK-ARM/*.uvguix.* -board/*/MDK-ARM/EventRecorderStub.scvd -board/*/MDK-ARM/*/*.htm -board/*/MDK-ARM/*/*.build_log.htm +board/*/KEIL/*/Obj/ +board/*/KEIL/*/RTE/ +board/*/KEIL/*/*.uvguix.* +board/*/KEIL/*/EventRecorderStub.scvd +board/*/KEIL/*/*/*.htm +board/*/KEIL/*/*/*.build_log.htm board/**/settings/* +.vscode \ No newline at end of file From 3c1eac5bb047bdbaae31d3a0dcf92c6f91ee9353 Mon Sep 17 00:00:00 2001 From: KYzhang_X Date: Sun, 31 Jul 2022 22:44:59 +0800 Subject: [PATCH 2/4] vfs: fix readdir bug --- components/fs/fatfs/wrapper/tos_fatfs_vfs.c | 2 +- components/fs/vfs/tos_vfs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/fs/fatfs/wrapper/tos_fatfs_vfs.c b/components/fs/fatfs/wrapper/tos_fatfs_vfs.c index eaa59950..d021e921 100644 --- a/components/fs/fatfs/wrapper/tos_fatfs_vfs.c +++ b/components/fs/fatfs/wrapper/tos_fatfs_vfs.c @@ -220,7 +220,7 @@ static int fatfs_readdir(vfs_dir_t *dir, vfs_dirent_t *dirent) dp = (DIR *)dir->private; res = tos_f_readdir(dp, &info); - if (res != FR_OK) { + if (res != FR_OK || info.fname[0] == 0) { return -1; } diff --git a/components/fs/vfs/tos_vfs.c b/components/fs/vfs/tos_vfs.c index 01352c25..b3e070df 100644 --- a/components/fs/vfs/tos_vfs.c +++ b/components/fs/vfs/tos_vfs.c @@ -430,7 +430,7 @@ __API__ vfs_dirent_t *tos_vfs_readdir(VFS_DIR *dirp) vfs_dir_t *dir = K_NULL; vfs_inode_t *inode = K_NULL; - if (!dir) { + if (!dirp) { return K_NULL; } From 30988eba920a63719232ca9dda55450c3841b9ff Mon Sep 17 00:00:00 2001 From: KYzhang_X Date: Mon, 1 Aug 2022 23:14:50 +0800 Subject: [PATCH 3/4] fatfs: fix stat bug --- components/fs/fatfs/wrapper/tos_ff.c | 1 + 1 file changed, 1 insertion(+) diff --git a/components/fs/fatfs/wrapper/tos_ff.c b/components/fs/fatfs/wrapper/tos_ff.c index 0c49c4b5..5a7819f4 100644 --- a/components/fs/fatfs/wrapper/tos_ff.c +++ b/components/fs/fatfs/wrapper/tos_ff.c @@ -4397,6 +4397,7 @@ FRESULT tos_f_stat ( /* Get logical drive */ res = find_volume(fs, 0); + dj.obj.fs = fs; if (res == FR_OK) { INIT_NAMBUF(dj.obj.fs); res = follow_path(&dj, path); /* Follow the file path */ From 24d7a9c591367dec443c6c727a139a9576afd257 Mon Sep 17 00:00:00 2001 From: KYzhang_X Date: Tue, 2 Aug 2022 11:13:20 +0800 Subject: [PATCH 4/4] revise .gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 0d0f4b78..f1430943 100644 --- a/.gitignore +++ b/.gitignore @@ -33,4 +33,4 @@ board/*/KEIL/*/EventRecorderStub.scvd board/*/KEIL/*/*/*.htm board/*/KEIL/*/*/*.build_log.htm board/**/settings/* -.vscode \ No newline at end of file +.vscode