From 306555e5220f496a2e4dc513d6a0812abf95509f Mon Sep 17 00:00:00 2001 From: TuxSH Date: Sun, 6 May 2018 13:03:45 +0200 Subject: [PATCH] Fix mount code in fs_dev.c --- fusee/fusee-secondary/src/fs_dev.c | 16 +++------------- fusee/fusee-secondary/src/main.c | 6 +++--- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/fusee/fusee-secondary/src/fs_dev.c b/fusee/fusee-secondary/src/fs_dev.c index aaf16d6ea..8b0905901 100644 --- a/fusee/fusee-secondary/src/fs_dev.c +++ b/fusee/fusee-secondary/src/fs_dev.c @@ -94,11 +94,8 @@ int fsdev_mount_device(const char *name) { if (!g_devices[i].setup) { fsdev_fsdevice_t *device = &g_devices[i]; FRESULT rc; - char drname[40]; - strcpy(drname, name); - strcat(drname, ":"); - rc = f_mount(&device->fatfs, drname, 1); + rc = f_mount(&device->fatfs, name, 1); if (rc != FR_OK) { return fsdev_convert_rc(NULL, rc); @@ -130,7 +127,6 @@ int fsdev_set_default_device(const char *name) { #else int ret; - char drname[40]; int devid = FindDevice(name); if (devid == -1) { @@ -138,10 +134,7 @@ int fsdev_set_default_device(const char *name) { return -1; } - strcpy(drname, name); - strcat(drname, ":"); - - ret = fsdev_convert_rc(NULL, f_chdrive(drname)); + ret = fsdev_convert_rc(NULL, f_chdrive(name)); if (ret == 0) { setDefaultDevice(devid); @@ -153,17 +146,14 @@ int fsdev_set_default_device(const char *name) { int fsdev_unmount_device(const char *name) { int ret; - char drname[40]; int devid = FindDevice(name); if (devid == -1) { errno = ENOENT; return -1; } - strcpy(drname, name); - strcat(drname, ":"); - ret = fsdev_convert_rc(NULL, f_unmount(drname)); + ret = fsdev_convert_rc(NULL, f_unmount(name)); if (ret == 0) { fsdev_fsdevice_t *device = (fsdev_fsdevice_t *)(GetDeviceOpTab(name)->deviceData); diff --git a/fusee/fusee-secondary/src/main.c b/fusee/fusee-secondary/src/main.c index 15ccafbcf..5d9160a7f 100644 --- a/fusee/fusee-secondary/src/main.c +++ b/fusee/fusee-secondary/src/main.c @@ -31,6 +31,9 @@ int main(int argc, void **argv) { generic_panic(); } + /* Setup console/stdout. */ + console_resume(args.lfb, args.console_row, args.console_col); + resume_sd_state((struct mmc *)args.sd_mmc); fsdev_mount_all(); fsdev_set_default_device("sdmc"); @@ -40,9 +43,6 @@ int main(int argc, void **argv) { /* TODO: What other hardware init should we do here? */ - /* Setup console/stdout. */ - console_resume(args.lfb, args.console_row, args.console_col); - printf(u8"Welcome to Atmosphère Fusée Stage 2!\n"); printf("Stage 2 executing from: %s\n", (const char *)argv[STAGE2_ARGV_PROGRAM_PATH]);