diff options
author | Leo C | 2014-08-13 21:00:21 +0200 |
---|---|---|
committer | Leo C | 2014-08-13 21:00:21 +0200 |
commit | 72f5882239bb88b8a68f305802e0dde37a975604 (patch) | |
tree | a932ba22f7174de0fd773cf31d4d914dd548dfdd /avr/cli.c | |
parent | d684c21619905153eff68c43927207248925f6c2 (diff) | |
download | z180-stamp-72f5882239bb88b8a68f305802e0dde37a975604.zip |
Add memory commands (cmp, cp, md, mm, mw, nm)
Add kind of scheduler for background tasks
Diffstat (limited to 'avr/cli.c')
-rw-r--r-- | avr/cli.c | 13 |
1 files changed, 0 insertions, 13 deletions
@@ -296,15 +296,10 @@ int run_command_list(const char *cmd, int len) /****************************************************************************/ -#define DYN_BUFFER 1 void cli_loop(void) { -#if DYN_BUFFER char *lastcommand = NULL; -#else - static char lastcommand[CONFIG_SYS_CBSIZE]; -#endif int len; int flag; int rc = 1; @@ -314,15 +309,11 @@ void cli_loop(void) flag = 0; /* assume no special flags for now */ if (len > 0) { -#if DYN_BUFFER lastcommand = (char *) xrealloc(lastcommand, len+1); if (lastcommand != NULL) { strncpy(lastcommand, console_buffer, len+1); lastcommand[len] = '\0'; } -#else - strcpy(lastcommand, console_buffer); -#endif } else if (len == 0) flag |= CMD_FLAG_REPEAT; @@ -333,12 +324,8 @@ void cli_loop(void) if (rc <= 0) { /* invalid command or not repeatable, forget it */ -#if DYN_BUFFER free(lastcommand); lastcommand = NULL; -#else - lastcommand[0] = 0; -#endif } } } |