diff --git a/fatfs/ffconf.h b/fatfs/ffconf.h index 5c31826..d284cad 100644 --- a/fatfs/ffconf.h +++ b/fatfs/ffconf.h @@ -105,7 +105,9 @@ */ +#ifndef FF_USE_LFN #define FF_USE_LFN 2 +#endif #define FF_MAX_LFN 255 /* The FF_USE_LFN switches the support for LFN (long file name). / diff --git a/fatfs/go_fatfs_no_lfn.go b/fatfs/go_fatfs_no_lfn.go new file mode 100644 index 0000000..01a7466 --- /dev/null +++ b/fatfs/go_fatfs_no_lfn.go @@ -0,0 +1,11 @@ +//go:build no_lfn + +package fatfs + +// FF_USE_LFN controls long file name (LFN) support in FatFs (default: 2). +// Using the build tag no_lfn sets FF_USE_LFN=0 which disables LFN and +// restricts file names to the 8.3 short file name format. It also removes +// the Unicode conversion tables in ffunicode.c, resulting in ~60KB of flash savings. + +// #cgo CFLAGS: -DFF_USE_LFN=0 +import "C"