summaryrefslogtreecommitdiff
path: root/avr
diff options
context:
space:
mode:
authorLeo C2014-08-21 10:32:33 +0200
committerLeo C2014-08-21 10:32:33 +0200
commitdea9a31523216caa153c589426b175d52aa43634 (patch)
tree0becde7e85dc4ba156f8a10c9f5f6c0843de2f2e /avr
parent69988dc1f60ce27d2192eb2aa579962f585fffc8 (diff)
downloadz180-stamp-dea9a31523216caa153c589426b175d52aa43634.zip
Autocomplete, long way to go...
Diffstat (limited to 'avr')
-rw-r--r--avr/command.c5
-rw-r--r--avr/command.h2
-rw-r--r--avr/config.h1
-rw-r--r--avr/debug.c3
4 files changed, 9 insertions, 2 deletions
diff --git a/avr/command.c b/avr/command.c
index 9eb0ed2..15b1c72 100644
--- a/avr/command.c
+++ b/avr/command.c
@@ -194,7 +194,7 @@ command_ret_t cmd_usage(const FLASH cmd_tbl_t *cmdtp)
int var_complete(int argc, char * const argv[], char last_char, int maxv, char *cmdv[])
{
- static char tmp_buf[512];
+ static char tmp_buf[CONFIG_SYS_CBSIZE];
int space;
space = last_char == '\0' || isblank(last_char);
@@ -210,6 +210,8 @@ int var_complete(int argc, char * const argv[], char last_char, int maxv, char *
/*************************************************************************************/
+/* TODO: cmdtp points to FLASH */
+
static int complete_cmdv(int argc, char * const argv[], char last_char, int maxv, char *cmdv[])
{
cmd_tbl_t *cmdtp = cmd_tbl;
@@ -357,6 +359,7 @@ static int find_common_prefix(char * const argv[])
static char tmp_buf[CONFIG_SYS_CBSIZE]; /* copy of console I/O buffer */
+
int cmd_auto_complete(const FLASH char *const prompt, char *buf, int *np, int *colp)
{
int n = *np, col = *colp;
diff --git a/avr/command.h b/avr/command.h
index 4e96903..2fd20a0 100644
--- a/avr/command.h
+++ b/avr/command.h
@@ -82,7 +82,7 @@ command_ret_t cmd_usage(cmd_tbl_t *cmdtp);
#ifdef CONFIG_AUTO_COMPLETE
extern int var_complete(int argc, char * const argv[], char last_char, int maxv, char *cmdv[]);
-extern int cmd_auto_complete(const char *const prompt, char *buf, int *np, int *colp);
+extern int cmd_auto_complete(const FLASH char *const prompt, char *buf, int *np, int *colp);
#endif
/**
diff --git a/avr/config.h b/avr/config.h
index 13de63b..08d97bd 100644
--- a/avr/config.h
+++ b/avr/config.h
@@ -19,6 +19,7 @@
#define CONFIG_SYS_PROMPT "=> "
+/* TODO: */
//#define CONFIG_CMDLINE_EDITING 1
//#define CONFIG_AUTO_COMPLETE 1
diff --git a/avr/debug.c b/avr/debug.c
index 74d8ab2..fcbd2c1 100644
--- a/avr/debug.c
+++ b/avr/debug.c
@@ -227,6 +227,8 @@ command_ret_t do_eep_cp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[
/*------------------------------------------------------------------------------*/
+#if 0
+
struct __freelist {
size_t sz;
struct __freelist *nx;
@@ -265,6 +267,7 @@ printfreelist(const char * title)
(size_t) STACK_POINTER(), (size_t) __brkval, freesum);
}
+#endif
#endif /* DEBUG */