Added checks for successful mounting of SD/CTRNAND
This commit is contained in:
parent
51c1e5567a
commit
09435c282b
@ -10,14 +10,12 @@ static FATFS fs;
|
||||
|
||||
u32 mountSD(void)
|
||||
{
|
||||
if(f_mount(&fs, "0:", 1) != FR_OK) return 0;
|
||||
return 1;
|
||||
return f_mount(&fs, "0:", 1) == FR_OK;
|
||||
}
|
||||
|
||||
u32 mountCTRNAND(void)
|
||||
{
|
||||
if(f_mount(&fs, "1:", 1) != FR_OK) return 0;
|
||||
return 1;
|
||||
return f_mount(&fs, "1:", 1) == FR_OK;
|
||||
}
|
||||
|
||||
u32 fileRead(void *dest, const char *path)
|
||||
|
@ -59,7 +59,8 @@ void main(void)
|
||||
|
||||
static inline void installer(u32 a9lhBoot)
|
||||
{
|
||||
mountSD();
|
||||
if(!mountSD())
|
||||
shutdown(1, "Error: failed to mount the SD card");
|
||||
|
||||
const char *path;
|
||||
u32 updatea9lh = 0;
|
||||
@ -192,7 +193,8 @@ static inline void uninstaller(void)
|
||||
}
|
||||
else memset32((void *)SECTOR_OFFSET, 0, 0x200);
|
||||
|
||||
mountCTRNAND();
|
||||
if(!mountCTRNAND())
|
||||
shutdown(1, "Error: failed to mount CTRNAND");
|
||||
|
||||
switch(firmRead((void *)FIRM0_OFFSET))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user