File tree 3 files changed +8
-1
lines changed 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 70
70
#define MICROPY_FATFS_RPATH (2)
71
71
#define MICROPY_FATFS_VOLUMES (4)
72
72
#define MICROPY_FATFS_MULTI_PARTITION (1)
73
+ #define MICROPY_FATFS_NUM_PERSISTENT (1)
73
74
#define MICROPY_FSUSERMOUNT (1)
74
75
// Only enable this if you really need it. It allocates a byte cache of this
75
76
// size.
Original file line number Diff line number Diff line change 403
403
#define MICROPY_READER_FATFS (0)
404
404
#endif
405
405
406
+ // Number of VFS mounts to persist across soft-reset.
407
+ #ifndef MICROPY_FATFS_NUM_PERSISTENT
408
+ #define MICROPY_FATFS_NUM_PERSISTENT (0)
409
+ #endif
410
+
406
411
// Hook for the VM at the start of the opcode loop (can contain variable
407
412
// definitions usable by the other hook functions)
408
413
#ifndef MICROPY_VM_HOOK_INIT
Original file line number Diff line number Diff line change @@ -103,7 +103,8 @@ void mp_init(void) {
103
103
104
104
#if MICROPY_FSUSERMOUNT
105
105
// zero out the pointers to the user-mounted devices
106
- memset (MP_STATE_VM (fs_user_mount ), 0 , sizeof (MP_STATE_VM (fs_user_mount )));
106
+ memset (MP_STATE_VM (fs_user_mount ) + MICROPY_FATFS_NUM_PERSISTENT , 0 ,
107
+ sizeof (MP_STATE_VM (fs_user_mount )) - MICROPY_FATFS_NUM_PERSISTENT );
107
108
#endif
108
109
109
110
#if MICROPY_PY_THREAD_GIL
You can’t perform that action at this time.
0 commit comments