diff --git a/Ubiquitous/XiZi_AIoT/services/app/shell_port.c b/Ubiquitous/XiZi_AIoT/services/app/shell_port.c index 7f9c286c4..69164a88f 100644 --- a/Ubiquitous/XiZi_AIoT/services/app/shell_port.c +++ b/Ubiquitous/XiZi_AIoT/services/app/shell_port.c @@ -49,6 +49,7 @@ int main(void) shell.read = userShellRead; shellInit(&shell, shellBuffer, 512); + printf("shell init\n"); while (connect_session(&session_fs, "MemFS", 0x10000) < 0) ; diff --git a/Ubiquitous/XiZi_AIoT/services/boards/jh7110/libserial.c b/Ubiquitous/XiZi_AIoT/services/boards/jh7110/libserial.c index fcc87026a..409ce5f13 100644 --- a/Ubiquitous/XiZi_AIoT/services/boards/jh7110/libserial.c +++ b/Ubiquitous/XiZi_AIoT/services/boards/jh7110/libserial.c @@ -216,19 +216,19 @@ static inline int serial_in_shift(void* addr, int shift) bool init_uart_mmio() { - static int mapped = 0; - if (mapped == 0) { + static int mapped = 0xff; + if (mapped != 0) { if (-1 == mmap(UART_ADDR, UART_ADDR, 4096, true)) { return false; } - mapped = 1; + mapped = 0; } return true; } void putc(char ch) { - static struct NS16550* com_port = (struct NS16550*)UART_ADDR; + struct NS16550* com_port = (struct NS16550*)UART_ADDR; if (ch == '\n') { putc('\r'); @@ -241,7 +241,7 @@ void putc(char ch) char getc(void) { - static struct NS16550* com_port = (struct NS16550*)UART_ADDR; + struct NS16550* com_port = (struct NS16550*)UART_ADDR; while (!(serial_din(&com_port->lsr) & UART_LSR_DR)) ; diff --git a/Ubiquitous/XiZi_AIoT/services/shell/letter-shell/shell.c b/Ubiquitous/XiZi_AIoT/services/shell/letter-shell/shell.c index 34b99616e..ec1ff011b 100644 --- a/Ubiquitous/XiZi_AIoT/services/shell/letter-shell/shell.c +++ b/Ubiquitous/XiZi_AIoT/services/shell/letter-shell/shell.c @@ -203,6 +203,7 @@ void shellInit(Shell* shell, char* buffer, unsigned short size) shellAdd(shell); shellSetUser(shell, shellSeekCommand(shell, SHELL_DEFAULT_USER, shell->commandList.base, 0)); + shellWritePrompt(shell, 1); } @@ -322,9 +323,11 @@ static void shellWritePrompt(Shell* shell, unsigned char newline) if (newline) { shellWriteString(shell, "\r\n"); } +#ifndef __riscv shellWriteString(shell, shell->info.user->data.user.name); shellWriteString(shell, ":"); shellWriteString(shell, shell->info.path ? shell->info.path : "/"); +#endif shellWriteString(shell, "$ "); } else { shellWriteString(shell, shellText[SHELL_TEXT_PASSWORD_HINT]);