From ee5c86e95d96566ef89e374f9ee6abafd93e31be Mon Sep 17 00:00:00 2001 From: Leo C Date: Wed, 4 Apr 2018 21:23:51 +0200 Subject: [PATCH] ENV_HOME macro. 'fat help' command table entry --- avr/cmd_fat.c | 13 +++++++++++-- include/config.h | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/avr/cmd_fat.c b/avr/cmd_fat.c index 81ee945..e09b2a6 100644 --- a/avr/cmd_fat.c +++ b/avr/cmd_fat.c @@ -281,9 +281,9 @@ command_ret_t do_cd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) (void) cmdtp; (void) flag; (void) argc; if (argc < 2) { - arg = getenv_str(PSTR("HOME")); + arg = getenv_str(PSTR(ENV_HOME)); if (arg == NULL) { - printf_P(PSTR("%s: \"%S\" is not set\n"), argv[0], PSTR("HOME")); + printf_P(PSTR("%s: \"%S\" is not set\n"), argv[0], PSTR(ENV_HOME)); return CMD_RET_FAILURE; } } else @@ -579,6 +579,15 @@ CMD_TBL_ITEM( " starting at address 'addr'.\n" ), +CMD_TBL_ITEM( + help, CONFIG_SYS_MAXARGS, 1, do_help, + "Print sub command description/usage", + "\n" + " - print brief description of all sub commands\n" + "fat help command ...\n" + " - print detailed usage of sub cmd 'command'" +), + /* 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'"), diff --git a/include/config.h b/include/config.h index 2b67709..89f829d 100644 --- a/include/config.h +++ b/include/config.h @@ -25,6 +25,7 @@ #define ENV_STARTADDRESS "startaddress" #define ENV_ESC_CHAR "esc_char" +#define ENV_HOME "HOME" #define ENV_SINGLESTEP "singlestep" #define CONFIG_ENV_SIZE 1600 -- 2.39.2