1
0
Fork 0
mirror of https://github.com/suchmememanyskill/TegraExplorer.git synced 2024-09-19 21:43:40 +01:00

lets try that one again

This commit is contained in:
SuchMemeManySkill 2020-12-27 00:44:48 +01:00
parent 831adc0080
commit 3307e975c9

View file

@ -18,18 +18,27 @@ void SetKeySlots(){
} }
} }
LIST_INIT(curGpt);
void disconnectMMC(){ void disconnectMMC(){
if (TConf.connectedMMCMounted) if (TConf.connectedMMCMounted)
f_unmount("bis:"); f_unmount("bis:");
TConf.connectedMMCMounted = 0;
emummc_storage_end(&emmc_storage); if (TConf.currentMMCConnected != MMC_CONN_None){
TConf.connectedMMCMounted = 0;
TConf.currentMMCConnected = MMC_CONN_None;
emummc_storage_end(&emmc_storage);
nx_emmc_gpt_free(&curGpt);
list_empty(&curGpt);
}
} }
int connectMMC(u8 mmcType){ int connectMMC(u8 mmcType){
if (mmcType == TConf.currentMMCConnected) if (mmcType == TConf.currentMMCConnected)
return 0; return 0;
//disconnectMMC(); disconnectMMC();
emu_cfg.enabled = (mmcType == MMC_CONN_EMMC) ? 0 : 1; emu_cfg.enabled = (mmcType == MMC_CONN_EMMC) ? 0 : 1;
int res = emummc_storage_init_mmc(&emmc_storage, &emmc_sdmmc); int res = emummc_storage_init_mmc(&emmc_storage, &emmc_sdmmc);
if (!res) if (!res)
@ -39,8 +48,11 @@ int connectMMC(u8 mmcType){
} }
ErrCode_t mountMMCPart(const char *partition){ ErrCode_t mountMMCPart(const char *partition){
if (TConf.connectedMMCMounted)
return newErrCode(0);
emummc_storage_set_mmc_partition(&emmc_storage, 0); emummc_storage_set_mmc_partition(&emmc_storage, 0);
LIST_INIT(curGpt);
nx_emmc_gpt_parse(&curGpt, &emmc_storage); nx_emmc_gpt_parse(&curGpt, &emmc_storage);
emmc_part_t *system_part = nx_emmc_part_find(&curGpt, partition); emmc_part_t *system_part = nx_emmc_part_find(&curGpt, partition);
if (!system_part) if (!system_part)
@ -52,7 +64,6 @@ ErrCode_t mountMMCPart(const char *partition){
if ((res = f_mount(&emmc_fs, "bis:", 1))) if ((res = f_mount(&emmc_fs, "bis:", 1)))
return newErrCode(res); return newErrCode(res);
nx_emmc_gpt_free(&curGpt);
TConf.connectedMMCMounted = 1; TConf.connectedMMCMounted = 1;
return newErrCode(0); return newErrCode(0);
} }