File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7070#define MICROPY_FATFS_RPATH (2)
7171#define MICROPY_FATFS_VOLUMES (4)
7272#define MICROPY_FATFS_MULTI_PARTITION (1)
73+ #define MICROPY_FATFS_NUM_PERSISTENT (1)
7374#define MICROPY_FSUSERMOUNT (1)
7475// Only enable this if you really need it. It allocates a byte cache of this
7576// size.
Original file line number Diff line number Diff line change 403403#define MICROPY_READER_FATFS (0)
404404#endif
405405
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+
406411// Hook for the VM at the start of the opcode loop (can contain variable
407412// definitions usable by the other hook functions)
408413#ifndef MICROPY_VM_HOOK_INIT
Original file line number Diff line number Diff line change @@ -103,7 +103,8 @@ void mp_init(void) {
103103
104104 #if MICROPY_FSUSERMOUNT
105105 // 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 );
107108 #endif
108109
109110 #if MICROPY_PY_THREAD_GIL
You can’t perform that action at this time.
0 commit comments