From 92ea355756ebd92b8809ecb638ffb5355d89c5e9 Mon Sep 17 00:00:00 2001 From: Far Date: Tue, 7 Sep 2021 14:43:36 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=80=82=E9=85=8D=E4=B8=89=E6=96=B9?= =?UTF-8?q?=E5=BA=93FatFs=E5=8D=87=E7=BA=A7=E8=87=B3r0.14a=E7=89=88?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 适配了f_mkfs接口的修改 Signed-off-by: Far --- components/fs/fatfs/fatfs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/fs/fatfs/fatfs.c b/components/fs/fatfs/fatfs.c index 58fad513..02e4f245 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.fmt = option, + opt.n_sect = sectors, + res = f_mkfs(dev, &opt, g_workBuffer, FF_MAX_SS); if (res != FR_OK) { errno = FatfsErrno(res); ret = FS_FAILURE; @@ -1495,4 +1498,4 @@ struct FileOps g_fatfsFops = { .Getattr = fatfs_stat, .Fsync = fatfs_fsync, .Fstat = fatfs_fstat, -}; \ No newline at end of file +};