diff --git a/source/fatfs/diskio.c b/source/fatfs/diskio.c index 9e1f6df..2b62445 100644 --- a/source/fatfs/diskio.c +++ b/source/fatfs/diskio.c @@ -134,12 +134,14 @@ DSTATUS disk_initialize ( return RES_PARERR; } else if (pdrv < 4) { nand_type_sys = CheckNandType(NAND_SYSNAND); + if (!nand_type_sys) return RES_PARERR; } else if (pdrv < 7) { nand_type_emu = CheckNandType(NAND_EMUNAND); + if (!nand_type_emu) return RES_PARERR; } else if (pdrv < 10) { - if (!GetMountState()) - return RES_PARERR; + if (!GetMountState()) return RES_PARERR; nand_type_img = CheckNandType(NAND_IMGNAND); + if (!nand_type_img) return RES_PARERR; } return RES_OK; } diff --git a/source/fs.c b/source/fs.c index 3964918..c7fc668 100644 --- a/source/fs.c +++ b/source/fs.c @@ -35,8 +35,8 @@ bool InitExtFS() { for (u32 i = 1; i < NORM_FS; i++) { char fsname[8]; snprintf(fsname, 7, "%lu:", i); - if (f_mount(fs + i, fsname, 1) != FR_OK) return false; - fs_mounted[i] = true; + if (f_mount(fs + i, fsname, 1) == FR_OK) + fs_mounted[i] = true; } return true; }