Keep RAMdrive mounted when unmounting SD

This commit is contained in:
d0k3 2016-05-02 11:04:53 +02:00
parent 8a65f79712
commit 89cca90447
2 changed files with 3 additions and 2 deletions

View File

@ -38,7 +38,7 @@ bool InitExtFS() {
snprintf(fsname, 7, "%lu:", i); snprintf(fsname, 7, "%lu:", i);
fs_mounted[i] = (f_mount(fs + i, fsname, 1) == FR_OK); fs_mounted[i] = (f_mount(fs + i, fsname, 1) == FR_OK);
if ((i == 7) && !fs_mounted[7] && (GetMountState() == IMG_RAMDRV)) { if ((i == 7) && !fs_mounted[7] && (GetMountState() == IMG_RAMDRV)) {
f_mkfs("7:", 0, 0); // format ramdrive f_mkfs("7:", 0, 0); // format ramdrive if required
f_mount(NULL, fsname, 1); f_mount(NULL, fsname, 1);
fs_mounted[7] = (f_mount(fs + 7, "7:", 1) == FR_OK); fs_mounted[7] = (f_mount(fs + 7, "7:", 1) == FR_OK);
} }

View File

@ -408,7 +408,8 @@ u32 GodMode() {
} }
} else if (switched && (pad_state & BUTTON_B)) { // unmount SD card } else if (switched && (pad_state & BUTTON_B)) { // unmount SD card
DeinitExtFS(); DeinitExtFS();
MountImage(NULL); if (GetMountState() != IMG_RAMDRV)
MountImage(NULL);
DeinitSDCardFS(); DeinitSDCardFS();
clipboard->n_entries = 0; clipboard->n_entries = 0;
memset(panedata, 0x00, N_PANES * sizeof(PaneData)); memset(panedata, 0x00, N_PANES * sizeof(PaneData));