Skip to content

Commit 1e0f36e

Browse files
de-nordicfabiobaltieri
authored andcommitted
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 2e96110 commit 1e0f36e

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
@@ -122,6 +122,15 @@ config FS_FATFS_LFN_MODE_HEAP
122122

123123
endchoice
124124

125+
config FS_FATFS_FF_USE_LFN
126+
int
127+
default 1 if FS_FATFS_LFN_MODE_BSS
128+
default 2 if FS_FATFS_LFN_MODE_STACK
129+
default 3 if FS_FATFS_LFN_MODE_HEAP
130+
help
131+
Translates FS_FATFS_LFN_MODE selection to FF_USE_LFN, defined in ffconf.h,
132+
inside ELM FAT module.
133+
125134
config FS_FATFS_MAX_LFN
126135
int "Max filename length"
127136
range 12 255

0 commit comments

Comments
 (0)