diff options
author | Damien George <damien.p.george@gmail.com> | 2017-01-31 12:18:08 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-01-31 12:18:08 +1100 |
commit | 3667ee1b8870ddc76f47260eb87d7d13736c9ad2 (patch) | |
tree | f5d4ccc743c9b7c8c64efa203fb59a0458b74188 /stmhal/sdcard.c | |
parent | 326343feebdd1ad990864cc830a30b6a44d44918 (diff) | |
download | micropython-3667ee1b8870ddc76f47260eb87d7d13736c9ad2.tar.gz micropython-3667ee1b8870ddc76f47260eb87d7d13736c9ad2.zip |
stmhal: On boot, mount all available partitions of the SD card.
The first partition is mounted as "/sd" and subsequent partitions are
mounted as "/sd<part_num>". This is backwards compatible with the previous
behaviour, which just mounted the first partition on "/sd".
At this point, only FatFs filesystems are mounted.
Diffstat (limited to 'stmhal/sdcard.c')
-rw-r--r-- | stmhal/sdcard.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/stmhal/sdcard.c b/stmhal/sdcard.c index f4ad985048..6e9c46df54 100644 --- a/stmhal/sdcard.c +++ b/stmhal/sdcard.c @@ -443,11 +443,11 @@ const mp_obj_type_t pyb_sdcard_type = { .locals_dict = (mp_obj_t)&pyb_sdcard_locals_dict, }; -void sdcard_init_vfs(fs_user_mount_t *vfs) { +void sdcard_init_vfs(fs_user_mount_t *vfs, int part) { vfs->base.type = &mp_fat_vfs_type; vfs->flags |= FSUSER_NATIVE | FSUSER_HAVE_IOCTL; vfs->fatfs.drv = vfs; - vfs->fatfs.part = 0; // autodetect partition + vfs->fatfs.part = part; vfs->readblocks[0] = (mp_obj_t)&pyb_sdcard_readblocks_obj; vfs->readblocks[1] = (mp_obj_t)&pyb_sdcard_obj; vfs->readblocks[2] = (mp_obj_t)sdcard_read_blocks; // native version |