修复了arduino keys 命令显示异常的问题

This commit is contained in:
hqm 2021-09-28 15:35:46 +08:00
parent 04b37b775b
commit 5301a57bb1
3 changed files with 5 additions and 8 deletions

View File

@ -9,8 +9,6 @@
#include <Arduino.h>
#include "xcmd.h"
#include "test.h"
#include "ex_keys.h"
#include "ex_cmds.h"
int cmd_get_char(uint8_t *ch)
{
@ -36,8 +34,6 @@ void setup() {
xcmd_init(cmd_get_char, cmd_put_char);
test_cmd_init();
test_keys_init();
ex_keys_init();
ex_cmds_init();
}
void loop() {

View File

@ -16,7 +16,7 @@ extern "C" {
#define VERSION "1.0.0"
#ifndef XCMD_LINE_MAX_LENGTH
#define XCMD_LINE_MAX_LENGTH (32) /* 命令行支持的最大字符数 */
#define XCMD_LINE_MAX_LENGTH (64) /* 命令行支持的最大字符数 */
#endif
#ifndef XCMD_PRINT_BUF_MAX_LENGTH
@ -24,7 +24,7 @@ extern "C" {
#endif
#ifndef XCMD_HISTORY_MAX_NUM
#define XCMD_HISTORY_MAX_NUM (0) /* 支持的历史记录个数0为不支持 */
#define XCMD_HISTORY_MAX_NUM (8) /* 支持的历史记录个数, 这个参数对内存的影响很大建议arduino设置为00为不支持 */
#endif
#ifndef XCMD_PARAM_MAX_NUM

View File

@ -31,7 +31,8 @@ static void cmd_keys(int argc, char* argv[])
xcmd_key_t *p = xcmd_keylist_get();
while(p)
{
xcmd_print("0x%08X %s\r\n", p->key, p->help);
xcmd_print("0x%08X\t", p->key);
xcmd_print("%s\r\n",p->help);
p = p->next;
}
}
@ -52,7 +53,7 @@ static xcmd_t cmds[] =
{
{"clear", cmd_clear, "clear screen"},
{"help", cmd_help, "show this list"},
{"keys", cmd_keys, "show keys", NULL},
{"keys", cmd_keys, "show keys"},
{"logo", cmd_logo, "show logo"},
};