diff --git a/demos/bsp/boards/ansi_escape.h b/demos/bsp/boards/ansi_escape.h index 98bf1db7..a309b225 100644 --- a/demos/bsp/boards/ansi_escape.h +++ b/demos/bsp/boards/ansi_escape.h @@ -67,6 +67,7 @@ #define ANSI_CURSOR_BACKWARD(n) CSI_CODE(#n "D") #define ANSI_CURSOR_LINE_DOWN(n) CSI_CODE(#n "E") #define ANSI_CURSOR_LINE_UP(n) CSI_CODE(#n "F") +#define ANSI_CURSOR_POSITION(n, m) CSI_CODE(#n ";" #m "H") #define ANSI_ERASE_SCREEN(n) CSI_CODE(#n "J") #define ANSI_ERASE_LINE(n) CSI_CODE(#n "K") diff --git a/demos/host/src/cli.c b/demos/host/src/cli.c index 73736976..8e5900ab 100644 --- a/demos/host/src/cli.c +++ b/demos/host/src/cli.c @@ -81,7 +81,7 @@ static char const * const cli_error_message[] = ENTRY(cls , cli_cmd_clear , "Clear the screen." ) \ ENTRY(ls , cli_cmd_list , "List information about the FILEs (the current directory by default).") \ ENTRY(cd , cli_cmd_changedir, "change the current directory." ) \ - ENTRY(cat , cli_cmd_cat , "display contents of a text file." ) \ + ENTRY(cat , cli_cmd_cat , "display contents of a file." ) \ ENTRY(cp , cli_cmd_copy , "Copies one or more files to another location." ) \ ENTRY(mkdir , cli_cmd_mkdir , "Create a DIRECTORY, if it does not already exist." ) \ @@ -241,7 +241,8 @@ cli_error_t cli_cmd_help(char * para) //--------------------------------------------------------------------+ cli_error_t cli_cmd_clear(char* p_para) { - printf(ANSI_ERASE_SCREEN(2)); + printf(ANSI_ERASE_SCREEN(2) ANSI_CURSOR_POSITION(1,1) ); + return CLI_ERROR_NONE; } //--------------------------------------------------------------------+ @@ -345,6 +346,13 @@ cli_error_t cli_cmd_cat(char *p_para) //--------------------------------------------------------------------+ // Make Directory command //--------------------------------------------------------------------+ +cli_error_t cli_cmd_mkdir(char *p_para) +{ + puts("executing mkdir"); + + return CLI_ERROR_NONE; +} + //--------------------------------------------------------------------+ // COPY command //--------------------------------------------------------------------+ diff --git a/demos/host/src/msc_app.c b/demos/host/src/msc_app.c index 2cbe8466..efb552ad 100644 --- a/demos/host/src/msc_app.c +++ b/demos/host/src/msc_app.c @@ -95,6 +95,13 @@ void tusbh_msc_mounted_cb(uint8_t dev_addr) return; } + puts("---------------------------------------------------------------------"); + puts("- MASSSTORAGE CLASS CLI IS A NON-MATURE CODE. DISK-WRITING COMMANDS -"); + puts("- SUCH AS cp(COPY), mkdir(MAKE DIRECTORY) ARE POTENTIAL TO DAMAGE -"); + puts("- YOUR USB THUMBDRIVE. USING THOSE COMMANDS ARE AT YOUR OWN RISK. -"); + puts("- THE AUTHOR HAS NO RESPONSIBILITY WITH YOUR DEVICE NOR ITS DATA -"); + puts("---------------------------------------------------------------------"); + f_chdrive(dev_addr-1); // change to newly mounted drive f_chdir("/"); // root as current dir