From 8ac807aee680cc8725f62a883ebff8b2d8de55d7 Mon Sep 17 00:00:00 2001 From: cfif Date: Mon, 6 Apr 2026 17:16:34 +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 | 7 +++++-- CommandLines.h | 5 ++++- TasksInfo.c | 7 +++++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CommandLines.c b/CommandLines.c index 3eeec67..3d7380f 100644 --- a/CommandLines.c +++ b/CommandLines.c @@ -29,13 +29,16 @@ int32_t CliCmd_baseCommandReboot(void *env, tCliCmd *cli) { } -void CommandLine_Init(tCommandLine *env, tSerialPortIO *cliVirtualPortIn_Io, tSerialPortIO *cliVirtualPortOut_Io) { +void CommandLine_Init(tCommandLine *env, uint8_t *countBufLoggerNames, tSerialPortIO *cliVirtualPortIn_Io, + tSerialPortIO *cliVirtualPortOut_Io) { + + env->countBufLoggerNames = countBufLoggerNames; CliCmd_InitStatic(&env->cmd, cliVirtualPortIn_Io, cliVirtualPortOut_Io, env->mem.cmdRxLine); CliRedirectionTable_InitStatic(&env->redirectTable, env->mem.commandPrefixes); CliRedirectionTable_RecAddStatic(&env->redirectTable, "help", CliCmd_baseCommandHelp, NULL); - CliRedirectionTable_RecAddStatic(&env->redirectTable, "mem", vTaskGetRunTime, NULL); + CliRedirectionTable_RecAddStatic(&env->redirectTable, "mem", vTaskGetRunTime, env); CliRedirectionTable_RecAddStatic(&env->redirectTable, "reboot", CliCmd_baseCommandReboot, NULL); diff --git a/CommandLines.h b/CommandLines.h index 1f510f7..61a4691 100644 --- a/CommandLines.h +++ b/CommandLines.h @@ -21,6 +21,8 @@ typedef struct { tCliRedirectTable redirectTable; + uint8_t *countBufLoggerNames; + struct { osThreadId_t id; uint32_t stack[400]; @@ -32,7 +34,8 @@ typedef struct { int32_t vTaskGetRunTime(void *env, tCliCmd *cli); -void CommandLine_Init(tCommandLine *env, tSerialPortIO *cliVirtualPortIn_Io, tSerialPortIO *cliVirtualPortOut_Io); +void CommandLine_Init(tCommandLine *env, uint8_t *countBufLoggerNames, tSerialPortIO *cliVirtualPortIn_Io, + tSerialPortIO *cliVirtualPortOut_Io); void CommandLine_StartThread(tCommandLine *env); #endif //WATER_BLACKBOX2_G_COMMANDLINES_H diff --git a/TasksInfo.c b/TasksInfo.c index bde45f0..21675c6 100644 --- a/TasksInfo.c +++ b/TasksInfo.c @@ -3,12 +3,15 @@ // #include #include +#include "CommandLines.h" #include "CliRedirectTable.h" #include "CmsisRtosThreadUtils.h" +#include "LoggerInterface.h" char bufSprintf[1024]; int32_t vTaskGetRunTime(void *env, tCliCmd *cli) { + tCommandLine *envCommandLine = env; volatile UBaseType_t uxArraySize, x; @@ -39,5 +42,9 @@ 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); + p = strlen(bufSprintf); + CliCmd_Print(cli, bufSprintf, p); + return 0; } \ No newline at end of file