From 3c17881e6146797ee75fc6f59056b9b79e686703 Mon Sep 17 00:00:00 2001 From: wdx04 Date: Thu, 4 May 2023 08:27:42 +0800 Subject: [PATCH] fix compiling errors of FATFileSystem when exFAT was enabled --- storage/filesystem/fat/ChaN/ff.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/storage/filesystem/fat/ChaN/ff.cpp b/storage/filesystem/fat/ChaN/ff.cpp index 70e2d3f239f..53b23a71700 100644 --- a/storage/filesystem/fat/ChaN/ff.cpp +++ b/storage/filesystem/fat/ChaN/ff.cpp @@ -537,7 +537,7 @@ static WCHAR LfnBuf[FF_MAX_LFN + 1]; /* LFN working buffer */ #elif FF_USE_LFN == 3 /* LFN enabled with dynamic working buffer on the heap */ #if FF_FS_EXFAT #define DEF_NAMBUF WCHAR *lfn; /* Pointer to LFN working buffer and directory entry block scratchpad buffer */ -#define INIT_NAMBUF(fs) { lfn = ff_memalloc((FF_MAX_LFN+1)*2 + MAXDIRB(FF_MAX_LFN)); if (!lfn) LEAVE_FF(fs, FR_NOT_ENOUGH_CORE); (fs)->lfnbuf = lfn; (fs)->dirbuf = (BYTE*)(lfn+FF_MAX_LFN+1); } +#define INIT_NAMBUF(fs) { lfn = (WCHAR *)(ff_memalloc((FF_MAX_LFN+1)*2 + MAXDIRB(FF_MAX_LFN))); if (!lfn) LEAVE_FF(fs, FR_NOT_ENOUGH_CORE); (fs)->lfnbuf = lfn; (fs)->dirbuf = (BYTE*)(lfn+FF_MAX_LFN+1); } #define FREE_NAMBUF() ff_memfree(lfn) #else #define DEF_NAMBUF WCHAR *lfn; /* Pointer to LFN working buffer */ @@ -555,6 +555,7 @@ static WCHAR LfnBuf[FF_MAX_LFN + 1]; /* LFN working buffer */ + /*--------------------------------*/ /* Code conversion tables */ /*--------------------------------*/