repair a bug of inputting password of shell

This commit is contained in:
Wang_Weigen 2021-12-14 10:37:22 +08:00
parent f2ba792380
commit e366c8817c
3 changed files with 8 additions and 4 deletions

View File

@ -17,10 +17,11 @@
extern int FrameworkInit(); extern int FrameworkInit();
extern void ApplicationOtaTaskInit(void); extern void ApplicationOtaTaskInit(void);
extern void Ch4As830(void); extern void ShowMemory(void);
extern long ShowTask(void);
int main(void) int main(void)
{ {
printf("Hello, world!\n"); printf("Hello, world! Running on gapuino board.\n");
FrameworkInit(); FrameworkInit();
#ifdef APPLICATION_OTA #ifdef APPLICATION_OTA
ApplicationOtaTaskInit(); ApplicationOtaTaskInit();

View File

@ -68,7 +68,8 @@ void InitBoardHardware(void)
timer_initialize(); timer_initialize();
KPrintf("memory address range: [0x%08x - 0x%08x], size: %d\n", (x_ubase) MEMORY_START_ADDRESS, (x_ubase) MEMORY_END_ADDRESS, GAP8_SRAM_SIZE); KPrintf("memory address range: [0x%08x - 0x%08x], size: %d\n", (x_ubase) MEMORY_START_ADDRESS, (x_ubase) MEMORY_END_ADDRESS, GAP8_SRAM_SIZE);
/* initialize memory system */ /* initialize memory system */
KPrintf("gap8 cluster id: [0x%x], _procid: [0x%x]\n", _clusterid(),_procid()); KPrintf("gap8 cluster id: [0x%x], _procid: [0x%x]\n", _clusterid(),_procid());
KPrintf("board init done.\n"); KPrintf("board init done.\n");
KPrintf("start kernel...\n"); KPrintf("start kernel...\n");
return; return;

View File

@ -155,6 +155,7 @@ ShellCommand* shellSeekCommand(Shell *shell,
*/ */
void shellInit(Shell *shell, char *buffer, unsigned short size) void shellInit(Shell *shell, char *buffer, unsigned short size)
{ {
shell->parser.length = 0; shell->parser.length = 0;
shell->parser.cursor = 0; shell->parser.cursor = 0;
shell->history.offset = 0; shell->history.offset = 0;
@ -187,6 +188,7 @@ void shellInit(Shell *shell, char *buffer, unsigned short size)
SHELL_DEFAULT_USER, SHELL_DEFAULT_USER,
shell->commandList.base, shell->commandList.base,
0)); 0));
shellWriteCommandLine(shell, 1); shellWriteCommandLine(shell, 1);
} }
@ -863,7 +865,7 @@ ShellCommand* shellSeekCommand(Shell *shell,
name = shellGetCommandName(&base[i]); name = shellGetCommandName(&base[i]);
if (!compareLength) if (!compareLength)
{ {
if (strcmp(cmd, name) == 0) if (strncmp(cmd, name, strlen(cmd)) == 0)
{ {
return &base[i]; return &base[i];
} }