summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo C2018-04-04 21:23:51 +0200
committerLeo C2018-07-21 12:04:30 +0200
commitb5251896f0f5eab98408808848b6236d234b370e (patch)
tree40d6b0a3385b4a7fb47b5b0c1d43e53ed54a890c
parent8a2b0da07c62b1ab1d9d2240268fbf71f59421dd (diff)
downloadz180-stamp-b5251896f0f5eab98408808848b6236d234b370e.zip
ENV_HOME macro. 'fat help' command table entry
-rw-r--r--avr/cmd_fat.c13
-rw-r--r--include/config.h1
2 files changed, 12 insertions, 2 deletions
diff --git a/avr/cmd_fat.c b/avr/cmd_fat.c
index 6519688..a1de1b6 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 37373c7..54cbc98 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