]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - avr/command_tbl.c
Merge branch 'master' into timelib
[z180-stamp.git] / avr / command_tbl.c
index 97110fd4f4649f6f651734a4524cb8cae026114b..e5c6567b667395064fb05514016893d813d6e07f 100644 (file)
@@ -22,6 +22,12 @@ extern command_ret_t do_busreq_pulse(cmd_tbl_t *, int, int, char * const []);
 extern command_ret_t do_date(cmd_tbl_t *, int, int, char * const []);
 extern command_ret_t do_gpio(cmd_tbl_t *, int, int, char * const []);
 extern command_ret_t do_sd(cmd_tbl_t *, int, int, char * const []);
+extern command_ret_t do_fat_stat(cmd_tbl_t *, int, int, char * const []);
+extern command_ret_t do_fat_ls(cmd_tbl_t *, int, int, char * const []);
+//extern command_ret_t do_fat_read(cmd_tbl_t *, int, int, char * const []);
+//extern command_ret_t do_fat_write(cmd_tbl_t *, int, int, char * const []);
+extern command_ret_t do_fat_rw(cmd_tbl_t *, int, int, char * const []);
+extern command_ret_t do_testarg(cmd_tbl_t *, int, int, char * const []);
 
 #ifdef CONFIG_SYS_LONGHELP
 const FLASH char sd_help_text[] =
@@ -42,6 +48,22 @@ CMD_TBL_ITEM(
 ),
 
 #ifdef DEBUG
+CMD_TBL_ITEM(
+       test,   CONFIG_SYS_MAXARGS,     1,      do_testarg,
+       "print arguments",
+       ""
+),
+CMD_TBL_ITEM(
+       tst1,   CONFIG_SYS_MAXARGS,     1,      do_testarg,
+       "print arguments",
+       ""
+),
+CMD_TBL_ITEM(
+       tst2,   CONFIG_SYS_MAXARGS,     1,      do_testarg,
+       "print arguments",
+       ""
+),
+
 CMD_TBL_ITEM(
        !mdr,   3,      1,      do_dump_mem,
        "RAM dump",
@@ -190,7 +212,7 @@ CMD_TBL_ITEM(
        "addr1 addr2 count"
 ),
 CMD_TBL_ITEM(
-       base,   2,      1,      do_mem_base,
+       base,   2,      0,      do_mem_base,
        "print or set address offset",
        "\n"
        "    - print address offset for memory commands\n"
@@ -231,6 +253,43 @@ CMD_TBL_ITEM(
 ),
 #endif /* CONFIG_MX_CYCLIC */
 
+CMD_TBL_ITEM(
+       sd,   CONFIG_SYS_MAXARGS, 1, do_sd,
+       "SD/MMC card handling commands",
+       "<subcommand> args ...\n"
+       "sd help\n"
+       "    - print help on subcommands"
+),
+
+CMD_TBL_ITEM(
+       fatstat,        2,      1,      do_fat_stat,
+       "Show logical drive status",
+       "dev"
+),
+CMD_TBL_ITEM(
+       fatls,  2,      1,      do_fat_ls,
+       "Directory listing",
+       "path"
+),
+CMD_TBL_ITEM(
+       fatload,        5,      0,      do_fat_rw,
+       "load binary file from a dos filesystem",
+       "<d:/path/filename> <addr> [bytes [pos]]\n"
+       "    - Load binary file 'path/filename' on logical drive 'd'\n"
+       "      to address 'addr' from dos filesystem.\n"
+       "      'pos' gives the file position to start loading from.\n"
+       "      If 'pos' is omitted, 0 is used. 'pos' requires 'bytes'.\n"
+       "      'bytes' gives the size to load. If 'bytes' is 0 or omitted,\n"
+       "      the load stops on end of file."
+),
+CMD_TBL_ITEM(
+       fatwrite,       4,      0,      do_fat_rw,
+       "write file into a dos filesystem",
+       "<d:/path/filename> <addr> <bytes>\n"
+       "    - Write file to 'path/filename' on logical drive 'd' from RAM\n"
+       "      starting at address 'addr'. 'bytes' gives the size to load.\n"
+       "      If 'bytes' is 0 or omitted, the load stops on end of file."
+),
 
 CMD_TBL_ITEM(
        help,   CONFIG_SYS_MAXARGS,     1,      do_help,
@@ -241,17 +300,6 @@ CMD_TBL_ITEM(
        "       - print detailed usage of 'command'"
 ),
 
-/* TODO: make macro CMD_TBL_ITEM work with this */
-       {FSTR("sd"),   CONFIG_SYS_MAXARGS, 1, do_sd,
-        FSTR("SD/MMC card handling commands"),
-#ifdef  CONFIG_SYS_LONGHELP
-       sd_help_text,
-#endif /* CONFIG_SYS_LONGHELP */
-#ifdef CONFIG_AUTO_COMPLETE
-       0,
-#endif
-},
-
 /* This does not use the CMD_TBL_ITEM macro as ? can't be used in symbol names */
        {FSTR("?"),   CONFIG_SYS_MAXARGS, 1, do_help,
         FSTR("alias for 'help'"),