Fix some bugs

This commit is contained in:
hqm 2021-09-18 21:15:18 +08:00
parent 8e5ab94a6d
commit 86eb0b82ab
1 changed files with 5 additions and 9 deletions

View File

@ -303,15 +303,11 @@ char* xcmd_display_get(void)
void xcmd_display_clear(void) void xcmd_display_clear(void)
{ {
char *line = xcmd_display_get(); char *line = xcmd_display_get();
uint16_t len = strlen(line); xcmd_print(DL(0));
if(len) xcmd_print("\r%s", g_xcmder.parser.prompt);
{ g_xcmder.parser.byte_num = 0;
xcmd_print(DL(0)); g_xcmder.parser.cursor = 0;
xcmd_print("\r%s", g_xcmder.parser.prompt); line[0] = '\0';
g_xcmder.parser.byte_num = 0;
g_xcmder.parser.cursor = 0;
line[0] = '\0';
}
} }
void xcmd_display_insert_char(char c) void xcmd_display_insert_char(char c)