From 8cf75d80fdf730689cdfadb8b709d2da07a11231 Mon Sep 17 00:00:00 2001 From: wangchen <253227059@qq.com> Date: Tue, 31 May 2022 09:00:54 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20FatFs=E5=8D=87=E7=BA=A7r0.14a=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=90=8C=E6=AD=A53.0=E5=88=86=E6=94=AF=20=E3=80=90?= =?UTF-8?q?=E8=83=8C=E6=99=AF=E3=80=91FatFs=E5=8D=87=E7=BA=A7r0.14a?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=90=8C=E6=AD=A53.0=E5=88=86=E6=94=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【修改方案】 将三方库FatFs升级至r0.14a版本 主要修改点为: 适配f_mkfs接口更新 【影响】 对现有的产品编译不会有影响。 re #I5A7AS Signed-off-by: wangchen Change-Id: I571f458a19d04520c86ab0ed63edcabb25d80e5e --- components/fs/fatfs/fatfs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/fs/fatfs/fatfs.c b/components/fs/fatfs/fatfs.c index 58fad513..a2c80df7 100644 --- a/components/fs/fatfs/fatfs.c +++ b/components/fs/fatfs/fatfs.c @@ -1432,6 +1432,7 @@ int fatfs_format(const char *dev, int sectors, int option) INT32 index; FRESULT res; INT32 ret; + MKFS_PARM opt = {0}; if (dev == NULL) { errno = EFAULT; @@ -1458,7 +1459,9 @@ int fatfs_format(const char *dev, int sectors, int option) goto OUT; } - res = f_mkfs(dev, option, sectors, g_workBuffer, FF_MAX_SS); + opt.n_sect = sectors; + opt.fmt = (BYTE)option; + res = f_mkfs(dev, &opt, g_workBuffer, FF_MAX_SS); if (res != FR_OK) { errno = FatfsErrno(res); ret = FS_FAILURE;