Skip to content

Commit 43d822e

Browse files
committed
fs/fatfs: Move FF_USE_LFN logic to Kconfig
Commit add hidden Kconfig option CONFIG_FS_FATFS_FF_USE_LFN that is passed to ELM FAT to define FF_USE_LFN configuration. The FF_USE_LFN still depends, indirectly, on choice CONFIG_FS_FATFS_LFN_MODE config options CONFIG_FS_FATFS_LFN_MODE_BSS, FS_FATFS_LFN_MODE_STACK and FS_FATFS_LFN_MODE_HEAP, but the logic has been moved out of zephyr_fatfs_config.h into Kconfig file. Signed-off-by: Dominik Ermel <[email protected]>
1 parent 0620cb1 commit 43d822e

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

modules/fatfs/zephyr_fatfs_config.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,10 @@
3333
#define FF_CODE_PAGE 437
3434
#endif /* defined(CONFIG_FS_FATFS_CODEPAGE) */
3535

36-
#if defined(CONFIG_FS_FATFS_LFN)
36+
#if defined(CONFIG_FS_FATFS_FF_USE_LFN)
37+
#if CONFIG_FS_FATFS_FF_USE_LFN <= 3
3738
#undef FF_USE_LFN
38-
#if CONFIG_FS_FATFS_LFN_MODE_BSS
39-
#define FF_USE_LFN 1
40-
#elif CONFIG_FS_FATFS_LFN_MODE_STACK
41-
#define FF_USE_LFN 2
42-
#elif CONFIG_FS_FATFS_LFN_MODE_HEAP
43-
#define FF_USE_LFN 3
39+
#define FF_USE_LFN CONFIG_FS_FATFS_FF_USE_LFN
4440
#else
4541
#error Invalid LFN buffer location
4642
#endif

subsys/fs/Kconfig.fatfs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,15 @@ config FS_FATFS_LFN_MODE_HEAP
9999

100100
endchoice
101101

102+
config FS_FATFS_FF_USE_LFN
103+
int
104+
default 1 if FS_FATFS_LFN_MODE_BSS
105+
default 2 if FS_FATFS_LFN_MODE_STACK
106+
default 3 if FS_FATFS_LFN_MODE_HEAP
107+
help
108+
Translates FS_FATFS_LFN_MODE selection to FF_USE_LFN, defined in ffconf.h,
109+
inside ELM FAT module.
110+
102111
config FS_FATFS_MAX_LFN
103112
int "Max filename length"
104113
range 12 255

0 commit comments

Comments
 (0)