From 95f198dfe45691ade52fd51a95b03804503237b5 Mon Sep 17 00:00:00 2001 From: cfif Date: Tue, 7 Apr 2026 13:54:58 +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 | 6 +++--- CommandLines.h | 5 +++-- TasksInfo.c | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CommandLines.c b/CommandLines.c index 3d7380f..759074e 100644 --- a/CommandLines.c +++ b/CommandLines.c @@ -29,12 +29,12 @@ int32_t CliCmd_baseCommandReboot(void *env, tCliCmd *cli) { } -void CommandLine_Init(tCommandLine *env, uint8_t *countBufLoggerNames, tSerialPortIO *cliVirtualPortIn_Io, +void CommandLine_Init(tCommandLine *env, tLoggerToSerialPort *loggerToSerialPort, tSerialPortIO *cliVirtualPortIn_Io, tSerialPortIO *cliVirtualPortOut_Io) { - env->countBufLoggerNames = countBufLoggerNames; + env->loggerToSerialPort = loggerToSerialPort; - CliCmd_InitStatic(&env->cmd, cliVirtualPortIn_Io, cliVirtualPortOut_Io, env->mem.cmdRxLine); + CliCmd_InitStatic(&env->cmd, loggerToSerialPort, cliVirtualPortIn_Io, cliVirtualPortOut_Io, env->mem.cmdRxLine); CliRedirectionTable_InitStatic(&env->redirectTable, env->mem.commandPrefixes); CliRedirectionTable_RecAddStatic(&env->redirectTable, "help", CliCmd_baseCommandHelp, NULL); diff --git a/CommandLines.h b/CommandLines.h index 61a4691..4bb4d1f 100644 --- a/CommandLines.h +++ b/CommandLines.h @@ -9,6 +9,7 @@ #include "SerialPort.h" #include "CliCmd.h" #include "CliRedirectTable.h" +#include "LoggerToSerialPort.h" typedef struct { @@ -21,7 +22,7 @@ typedef struct { tCliRedirectTable redirectTable; - uint8_t *countBufLoggerNames; + tLoggerToSerialPort *loggerToSerialPort; struct { osThreadId_t id; @@ -34,7 +35,7 @@ typedef struct { int32_t vTaskGetRunTime(void *env, tCliCmd *cli); -void CommandLine_Init(tCommandLine *env, uint8_t *countBufLoggerNames, tSerialPortIO *cliVirtualPortIn_Io, +void CommandLine_Init(tCommandLine *env, tLoggerToSerialPort *loggerToSerialPort, tSerialPortIO *cliVirtualPortIn_Io, tSerialPortIO *cliVirtualPortOut_Io); void CommandLine_StartThread(tCommandLine *env); diff --git a/TasksInfo.c b/TasksInfo.c index 21675c6..9471274 100644 --- a/TasksInfo.c +++ b/TasksInfo.c @@ -42,7 +42,7 @@ int32_t vTaskGetRunTime(void *env, tCliCmd *cli) { p = strlen(bufSprintf); CliCmd_Print(cli, bufSprintf, p); - sprintf(bufSprintf, "Free Logger Buf Size = %u\n", MAX_COUNT_BUF_LOG - (unsigned int)*envCommandLine->countBufLoggerNames); + sprintf(bufSprintf, "Free Logger Buf Size = %u\n", MAX_COUNT_BUF_LOG - (unsigned int)envCommandLine->loggerToSerialPort->countBufLoggerNames); p = strlen(bufSprintf); CliCmd_Print(cli, bufSprintf, p);