From 42ee2e0938c7adec8da26ac544204d32f3af709b Mon Sep 17 00:00:00 2001 From: Roman Vaughan Date: Sat, 30 May 2020 23:57:17 +1200 Subject: [PATCH] fs: Set MAX_FILE_NAME appropiately with LFN and FATFS Try to define MAX_FILE_NAME to the appropriate max length based on the selected filesystm. Otherwise fallback to a standard filename of 12 (made up of 8.3 : .) Signed-off-by: Roman Vaughan --- include/fs/fs_interface.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/include/fs/fs_interface.h b/include/fs/fs_interface.h index 42bbd1133bf..283e1cbcd41 100644 --- a/include/fs/fs_interface.h +++ b/include/fs/fs_interface.h @@ -13,9 +13,16 @@ extern "C" { #if defined(CONFIG_FILE_SYSTEM_LITTLEFS) #define MAX_FILE_NAME 256 -#else /* FAT_FS */ +#elif defined(CONFIG_FAT_FILESYSTEM_ELM) +#if defined(CONFIG_FS_FATFS_LFN) +#define MAX_FILE_NAME CONFIG_FS_FATFS_MAX_LFN +#else /* CONFIG_FS_FATFS_LFN */ #define MAX_FILE_NAME 12 /* Uses 8.3 SFN */ -#endif +#endif /* CONFIG_FS_FATFS_LFN */ +#else /* filesystem selection */ +/* Use standard 8.3 when no filesystem is explicitly selected */ +#define MAX_FILE_NAME 12 +#endif /* filesystem selection */ struct fs_mount_t;