Fix ramdrive init and deinit

This commit is contained in:
d0k3 2017-02-10 15:02:13 +01:00
parent b3d9394877
commit d05a72b05a
2 changed files with 6 additions and 3 deletions

View File

@ -35,7 +35,7 @@ bool InitExtFS() {
bool InitImgFS(const char* path) { bool InitImgFS(const char* path) {
// deinit image filesystem // deinit image filesystem
for (u32 i = (GetMountState() & IMG_NAND) ? NORM_FS - 1 : NORM_FS - IMGN_FS; i >= NORM_FS - IMGN_FS; i--) { for (u32 i = NORM_FS - IMGN_FS; i < NORM_FS; i++) {
char fsname[8]; char fsname[8];
snprintf(fsname, 7, "%lu:", i); snprintf(fsname, 7, "%lu:", i);
if (!fs_mounted[i]) continue; if (!fs_mounted[i]) continue;
@ -45,7 +45,10 @@ bool InitImgFS(const char* path) {
// (re)mount image, done if path == NULL // (re)mount image, done if path == NULL
MountImage(path); MountImage(path);
InitVirtualImageDrive(); InitVirtualImageDrive();
if (!GetMountState()) return false; if (!GetMountState()) {
fs_mounted[9] = (f_mount(fs + 9, "9:", 1) == FR_OK); // ram drive
return false;
}
// reinit image filesystem // reinit image filesystem
for (u32 i = NORM_FS - IMGN_FS; i < NORM_FS; i++) { for (u32 i = NORM_FS - IMGN_FS; i < NORM_FS; i++) {
char fsname[8]; char fsname[8];

View File

@ -605,7 +605,7 @@ u32 FileHandlerMenu(char* current_path, u32* cursor, u32* scroll, DirStruct* cur
bool in_output_path = (strncmp(current_path, OUTPUT_PATH, 256) == 0); bool in_output_path = (strncmp(current_path, OUTPUT_PATH, 256) == 0);
// special stuff, only available for known filetypes (see int special below) // special stuff, only available for known filetypes (see int special below)
bool mountable = (FTYPE_MOUNTABLE(filetype) && !(drvtype & DRV_IMAGE)); bool mountable = (FTYPE_MOUNTABLE(filetype) && !(drvtype & (DRV_IMAGE|DRV_RAMDRIVE)));
bool verificable = (FYTPE_VERIFICABLE(filetype)); bool verificable = (FYTPE_VERIFICABLE(filetype));
bool decryptable = (FYTPE_DECRYPTABLE(filetype)); bool decryptable = (FYTPE_DECRYPTABLE(filetype));
bool encryptable = (FYTPE_ENCRYPTABLE(filetype)); bool encryptable = (FYTPE_ENCRYPTABLE(filetype));