]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - avr/cmd_loadcpm3.c
fatfs f_mount now allways done globally at start up
[z180-stamp.git] / avr / cmd_loadcpm3.c
index f2a30f1e0a2f1faa0af692ea34c829e4ea323df3..fd685b2e48c3ebb45b4c0ef11011a81b4a016fc2 100644 (file)
@@ -65,7 +65,6 @@ command_ret_t do_loadcpm3(cmd_tbl_t *cmdtp, int flag, int argc, char * const arg
        uint16_t osentry_adr = 0;
        long offset = 0;
        char *fname;
-       FATFS FatFs;
        FIL File;
        /* TODO: put CONFIG_PATH_CPM3SYS in flash */
        char default_fname[] = CONFIG_PATH_CPM3SYS;
@@ -88,12 +87,9 @@ command_ret_t do_loadcpm3(cmd_tbl_t *cmdtp, int flag, int argc, char * const arg
        if (fname == NULL || *fname == '\0')
                fname = default_fname;
 
-       res = f_mount(&FatFs, fname, 0);
-       if (!res)
-               res = f_open(&File, fname, FA_READ );
+       res = f_open(&File, fname, FA_READ );
        if (res) {
                printf_P(PSTR("Error: failed to open '%s'\n"), fname);
-               f_mount(NULL, fname, 0);
                return CMD_RET_FAILURE;
        }
 
@@ -132,7 +128,6 @@ command_ret_t do_loadcpm3(cmd_tbl_t *cmdtp, int flag, int argc, char * const arg
 
 out:
        f_close(&File);
-       f_mount(NULL, fname, 0);
 
        if (res) {
                printf_P(PSTR("Error: failed to read '%s'\n"), fname);