summaryrefslogtreecommitdiff
path: root/lib/fatfs
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-02-09 14:31:26 +0000
committerDamien George <damien.p.george@gmail.com>2016-02-10 08:59:58 +0000
commit13a4c120ce2cdeb5aa1c210d9426d31e02898486 (patch)
tree9628c421a90678e336f315dfd3e6c1e114bf2e25 /lib/fatfs
parentc33ad60a676d46cb18883beedd6c383d6fae9dd8 (diff)
lib/fatfs: Add support for sector sizes larger than 512 bytes.
If MICROPY_FATFS_MAX_SS is defined to power of 2 value between 1024 and 4096, support for dynamic sector size in FatFs will be enabled. Note that FatFs reserves static buffer of MICROPY_FATFS_MAX_SS size for each filesystem in use, so that value should be set sparingly. Initial patch provided by @pfalcon.
Diffstat (limited to 'lib/fatfs')
-rw-r--r--lib/fatfs/ffconf.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/fatfs/ffconf.h b/lib/fatfs/ffconf.h
index 27e73e2b3..7bfb03add 100644
--- a/lib/fatfs/ffconf.h
+++ b/lib/fatfs/ffconf.h
@@ -217,7 +217,11 @@
#define _MIN_SS 512
+#ifdef MICROPY_FATFS_MAX_SS
+#define _MAX_SS (MICROPY_FATFS_MAX_SS)
+#else
#define _MAX_SS 512
+#endif
/* These options configure the range of sector size to be supported. (512, 1024,
/ 2048 or 4096) Always set both 512 for most systems, all type of memory cards and
/ harddisk. But a larger value may be required for on-board flash memory and some