Commit Graph
9 Commits
Author SHA1 Message Date
Adam Múdry d8c30644c7 fix(fatfs): fix formatting in relevant python files to satisfy pre-commit check 2026-04-09 12:56:30 +02:00
Adam Múdry 1d0d45f203 fix(fatfs): fix a bug in SFN generation from LFN and rewrite to match C algorithm
Rewrite build_lfn_short_entry_name() and add _gen_numname_suffix() helper
to match the gen_numname() algorithm in ff.c. This fixes:

- chr(order) producing raw binary instead of ASCII digits
- Collision for order >= 10 when str(order) makes the name exceed 8 chars
- Hex suffix with dynamic stem shortening (matching C implementation)
- CRC16-CCITT hash for seq > 5 to reduce collision probability

Also fix LDIR_Name2_SIZE typo in long_filename_utils.py (should be
LDIR_Name3_SIZE), which made the assertion guard too permissive.

Add ShortFilenameGenerationTestCase with 9 unit tests covering single-digit,
multi-digit, hash-based, and collision-free generation scenarios.
2026-04-09 12:53:43 +02:00
Martin Gaňo 7fb62d41d5 fatfsgen.py: omit cluster allocation when the file is empty 2022-09-29 16:18:56 +02:00
Martin Gaňo 567f5f963c fatfsgen.py: use lfn record when forbidden character detected in the file name
The file name is recorded as a LFN when it doesn't fit 8.3 pattern or if it contains characters prohibited in SFN
2022-09-21 15:22:51 +00:00
Martin Gaňo 53c2ea2d08 fatfsgen.py: enable multiple dots in the long file name 2022-09-16 13:50:12 +02:00
Martin Gaňo 131b28314e fatfsgen.py: fixed missing NULL terminator 2022-09-14 16:55:13 +02:00
Martin Gaňo 2ddcda29b3 fatfsparse.py: Add support for WL 2022-07-26 14:50:07 +02:00
Martin Gaňo 0f160c8f11 fatfs: enable long file names for fatfsparse.py 2022-06-09 15:51:03 +02:00
Martin Gano 8ef66536ed fatfsparse.py: add cluster chaining support to enable reading longer-than-sector files
Closes IDF-4975
2022-05-25 15:49:24 +02:00