From 3de04b4681766e6d53cd862b505775ff4bee9836 Mon Sep 17 00:00:00 2001 From: Micah Cowell Date: Sun, 15 Feb 2026 14:45:12 -0800 Subject: [PATCH] add no_lfn build tag --- fatfs/ffconf.h | 2 ++ fatfs/go_fatfs_no_lfn.go | 11 +++++++++++ 2 files changed, 13 insertions(+) create mode 100644 fatfs/go_fatfs_no_lfn.go 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"