summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-01-30 13:02:10 +1100
committerDamien George <damien.p.george@gmail.com>2017-01-30 13:02:10 +1100
commita52635245491214a6fe92dc357ff214bd6ff8892 (patch)
tree858639c1b2bc49056ae945be6778fc88876f2ea2
parent220abca311063e736489adb675c18a25ff725932 (diff)
downloadmicropython-a52635245491214a6fe92dc357ff214bd6ff8892.tar.gz
micropython-a52635245491214a6fe92dc357ff214bd6ff8892.zip
stmhal: Set the FatFs partition number when initialising VFS object.
stmhal has MULTI_PARTITION enabled for FatFs and so these values need to be initialised.
-rw-r--r--stmhal/sdcard.c1
-rw-r--r--stmhal/storage.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/stmhal/sdcard.c b/stmhal/sdcard.c
index b1d67f62ab..f4ad985048 100644
--- a/stmhal/sdcard.c
+++ b/stmhal/sdcard.c
@@ -447,6 +447,7 @@ void sdcard_init_vfs(fs_user_mount_t *vfs) {
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->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
diff --git a/stmhal/storage.c b/stmhal/storage.c
index 0a5b507394..ed8b4e87a2 100644
--- a/stmhal/storage.c
+++ b/stmhal/storage.c
@@ -507,6 +507,7 @@ void pyb_flash_init_vfs(fs_user_mount_t *vfs) {
vfs->base.type = &mp_fat_vfs_type;
vfs->flags |= FSUSER_NATIVE | FSUSER_HAVE_IOCTL;
vfs->fatfs.drv = vfs;
+ vfs->fatfs.part = 1; // flash filesystem lives on first partition
vfs->readblocks[0] = (mp_obj_t)&pyb_flash_readblocks_obj;
vfs->readblocks[1] = (mp_obj_t)&pyb_flash_obj;
vfs->readblocks[2] = (mp_obj_t)storage_read_blocks; // native version