From 49d80b9fbd499206f548fc210c42f9e812847cc0 Mon Sep 17 00:00:00 2001 From: cfif Date: Tue, 9 Dec 2025 17:09:13 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CommandLines.c | 11 ++++------- CommandLines.h | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/CommandLines.c b/CommandLines.c index 511d644..92f78bf 100644 --- a/CommandLines.c +++ b/CommandLines.c @@ -26,13 +26,13 @@ int32_t CliCmd_baseCommandReboot(void *env, tCliCmd *cli) { return 0; } -void CommandLine_Init(tCommandLine *env, tSerialPortIO *serial) { +void CommandLine_Init(tCommandLine *env, tSerialPortIO *cliVirtualPortIn_Io, tSerialPortIO *cliVirtualPortOut_Io) { - CliCmd_InitStatic(&env->cmd, serial, env->mem.cmdRxLine); + CliCmd_InitStatic(&env->cmd, cliVirtualPortIn_Io, cliVirtualPortOut_Io, env->mem.cmdRxLine); CliRedirectionTable_InitStatic(&env->redirectTable, env->mem.commandPrefixes); - CliRedirectionTable_RecAddStatic(&env->redirectTable, "help", (cliCall) CliCmd_baseCommandHelp, NULL); - CliRedirectionTable_RecAddStatic(&env->redirectTable, "reboot", (cliCall) CliCmd_baseCommandReboot, NULL); + CliRedirectionTable_RecAddStatic(&env->redirectTable, "help\n", (cliCall) CliCmd_baseCommandHelp, NULL); + CliRedirectionTable_RecAddStatic(&env->redirectTable, "reboot\n", (cliCall) CliCmd_baseCommandReboot, NULL); InitThreadAtrStatic(&env->thread.attr, "CommandLine", env->thread.controlBlock, env->thread.stack, osPriorityNormal); @@ -44,9 +44,6 @@ void ListenCLICommand(tCommandLine *env) { CliCmd_PrintStatic(&env->cmd, "Command "); CliCmd_Print(&env->cmd, env->cmd.rxLine.begin, env->cmd.rxLine.length - 1); CliCmd_PrintLnStatic(&env->cmd, " not found"); - CliCmd_PrintStatic(&env->cmd, "use "); - CliRedirectionTable_ListCmd(&env->redirectTable, &env->cmd, ' '); - CliCmd_PrintLnStatic(&env->cmd, ""); CliCmd_PrintLnStatic(&env->cmd, "Enter the command [ help ] for more information\n"); diff --git a/CommandLines.h b/CommandLines.h index 3250a80..cd7e14c 100644 --- a/CommandLines.h +++ b/CommandLines.h @@ -30,7 +30,7 @@ typedef struct { } tCommandLine; -void CommandLine_Init(tCommandLine *env, tSerialPortIO *serial); +void CommandLine_Init(tCommandLine *env, tSerialPortIO *cliVirtualPortIn_Io, tSerialPortIO *cliVirtualPortOut_Io); void CommandLine_StartThread(tCommandLine *env); #endif //WATER_BLACKBOX2_G_COMMANDLINES_H