uart_cmd: Add support for read commands with arguments

The syntax is really not obvious, but at least the implementation
is simple ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
Sylvain Munaut 2012-04-01 21:36:12 +02:00
parent 1ba8c169ee
commit b0baaab491
1 changed files with 5 additions and 0 deletions

View File

@ -159,6 +159,11 @@ int uart_cmd_char(struct cmd_state *cs, uint8_t ch)
rc = handle_cb(cs, CMD_OP_SET, cs->cmd.buf, cs->arg.buf);
uart_cmd_reset(cs);
break;
case '?':
uart_cmd_out(cs, "\n\r");
rc = handle_cb(cs, CMD_OP_GET, cs->cmd.buf, cs->arg.buf);
uart_cmd_reset(cs);
break;
case ' ':
case '\t':
/* ignore any whitespace */