From c4ec206b1658a3d41fd259b29ad0510c09bb5fe2 Mon Sep 17 00:00:00 2001 From: cfif Date: Tue, 9 Dec 2025 17:26:11 +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 | 10 ++++++++-- CommandLines.h | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CommandLines.c b/CommandLines.c index 92f78bf..26bd7ad 100644 --- a/CommandLines.c +++ b/CommandLines.c @@ -10,29 +10,35 @@ #include "math.h" #include "stdlib.h" + int32_t CliCmd_baseCommandHelp(void *env, tCliCmd *cli) { CliCmd_PrintLnStatic(cli, "================================================"); CliCmd_PrintLnStatic(cli, "Commands:"); CliCmd_PrintLnStatic(cli, ""); CliCmd_PrintLnStatic(cli, "reboot - Restarting the device"); + CliCmd_PrintLnStatic(cli, "mem - Task Information"); CliCmd_PrintLnStatic(cli, "================================================"); return 0; } + int32_t CliCmd_baseCommandReboot(void *env, tCliCmd *cli) { //NVIC_SystemReset(); return 0; } + + void CommandLine_Init(tCommandLine *env, tSerialPortIO *cliVirtualPortIn_Io, tSerialPortIO *cliVirtualPortOut_Io) { CliCmd_InitStatic(&env->cmd, cliVirtualPortIn_Io, cliVirtualPortOut_Io, env->mem.cmdRxLine); CliRedirectionTable_InitStatic(&env->redirectTable, env->mem.commandPrefixes); - CliRedirectionTable_RecAddStatic(&env->redirectTable, "help\n", (cliCall) CliCmd_baseCommandHelp, NULL); - CliRedirectionTable_RecAddStatic(&env->redirectTable, "reboot\n", (cliCall) CliCmd_baseCommandReboot, NULL); + CliRedirectionTable_RecAddStatic(&env->redirectTable, "help", (cliCall) CliCmd_baseCommandHelp, NULL); + CliRedirectionTable_RecAddStatic(&env->redirectTable, "reboot", (cliCall) CliCmd_baseCommandReboot, NULL); + CliRedirectionTable_RecAddStatic(&env->redirectTable, "mem", (cliCall) vTaskGetRunTime, NULL); InitThreadAtrStatic(&env->thread.attr, "CommandLine", env->thread.controlBlock, env->thread.stack, osPriorityNormal); diff --git a/CommandLines.h b/CommandLines.h index cd7e14c..074df77 100644 --- a/CommandLines.h +++ b/CommandLines.h @@ -23,7 +23,7 @@ typedef struct { struct { osThreadId_t id; - uint32_t stack[1024]; + uint32_t stack[512]; StaticTask_t controlBlock; osThreadAttr_t attr; } thread;