From c0f930e75ddcb18eb91593f8827dce36b8ce0179 Mon Sep 17 00:00:00 2001 From: "Such Meme, Many Skill" Date: Wed, 11 Dec 2019 17:17:10 +0100 Subject: [PATCH] Fix spelling mistake + sd still being mounted after format error --- source/tegraexplorer/te.c | 14 ++++++++++---- source/tegraexplorer/tools.c | 5 +++-- source/tegraexplorer/tools.h | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/source/tegraexplorer/te.c b/source/tegraexplorer/te.c index 7e2073a..b0de973 100644 --- a/source/tegraexplorer/te.c +++ b/source/tegraexplorer/te.c @@ -136,12 +136,18 @@ void te_main(){ switch(res){ case FORMAT_ALL_FAT32: - if (makewaitmenu("Are you sure you want to format your sd?\nThis action is irreversible!\n\nPress Vol+/- to cancel\n", "Press Power to continue", 10)) - format(1); + if (makewaitmenu("Are you sure you want to format your sd?\nThis action is irreversible!\n\nPress Vol+/- to cancel\n", "Press Power to continue", 10)){ + if (format(1)) + sd_mounted = false; + } + break; case FORMAT_EMUMMC: - if (makewaitmenu("Are you sure you want to format your sd?\nThis action is irreversible!\n\nPress Vol+/- to cancel\n", "Press Power to continue", 10)) - format(0); + if (makewaitmenu("Are you sure you want to format your sd?\nThis action is irreversible!\n\nPress Vol+/- to cancel\n", "Press Power to continue", 10)){ + if (format(0)) + sd_mounted = false; + } + break; } break; diff --git a/source/tegraexplorer/tools.c b/source/tegraexplorer/tools.c index 5b0e3bf..46089ed 100644 --- a/source/tegraexplorer/tools.c +++ b/source/tegraexplorer/tools.c @@ -86,7 +86,7 @@ int dumpfirmware(){ gfx_printf("PKG1 version: %d\n", pkg1ver); ret = f_mkdir("sd:/tegraexplorer"); - gfx_printf("Creating making sd:/tegraexplorer %d\n", ret); + gfx_printf("Creating sd:/tegraexplorer %d\n", ret); ret = f_mkdir("sd:/tegraexplorer/Firmware"); gfx_printf("Creating sd:/tegraexplorer/Firmware %d\n", ret); @@ -124,7 +124,7 @@ int dumpfirmware(){ return fail; } -void format(int mode){ +int format(int mode){ clearscreen(); int res; bool fatalerror = false; @@ -196,4 +196,5 @@ void format(int mode){ gfx_printf("\nPress any button to return%k\nTotal time taken: %ds", COLOR_WHITE, (get_tmr_s() - timer)); btn_wait(); + return fatalerror; } \ No newline at end of file diff --git a/source/tegraexplorer/tools.h b/source/tegraexplorer/tools.h index bdf9e65..5b8678b 100644 --- a/source/tegraexplorer/tools.h +++ b/source/tegraexplorer/tools.h @@ -2,5 +2,5 @@ void displayinfo(); void displaygpio(); -void format(int mode); +int format(int mode); int dumpfirmware(); \ No newline at end of file