Skip to content

Commit 156ee48

Browse files
committed
circuitpy_mpconfig: Disable flash multi-partition
This adds some additional code in mkfs which doesn't seem necessary, and Disabling it saves 172 bytes flash. Testing performed: Using a Feather M0 Adalogger, checked that * an sdcard could still be mounted (using adafruit_sdcard) * os.listdir() of "/" and "/sd" worked * CIRCUITPY still mounted
1 parent d2056a4 commit 156ee48

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

py/circuitpy_mpconfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
#define MICROPY_FATFS_LFN_CODE_PAGE (437)
133133
#define MICROPY_FATFS_USE_LABEL (1)
134134
#define MICROPY_FATFS_RPATH (2)
135-
#define MICROPY_FATFS_MULTI_PARTITION (1)
135+
#define MICROPY_FATFS_MULTI_PARTITION (0)
136136

137137
// Only enable this if you really need it. It allocates a byte cache of this size.
138138
// #define MICROPY_FATFS_MAX_SS (4096)

supervisor/shared/flash.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,9 @@ void supervisor_flash_init_vfs(fs_user_mount_t *vfs) {
213213
vfs->base.type = &mp_fat_vfs_type;
214214
vfs->flags |= FSUSER_NATIVE | FSUSER_HAVE_IOCTL;
215215
vfs->fatfs.drv = vfs;
216+
#if MICROPY_FATFS_MULTI_PARTITION
216217
vfs->fatfs.part = 1; // flash filesystem lives on first partition
218+
#endif
217219
vfs->readblocks[0] = (mp_obj_t)&supervisor_flash_obj_readblocks_obj;
218220
vfs->readblocks[1] = (mp_obj_t)&supervisor_flash_obj;
219221
vfs->readblocks[2] = (mp_obj_t)flash_read_blocks; // native version

0 commit comments

Comments
 (0)