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