From f8d079421f615e32dccc48e929e0050626d746fa Mon Sep 17 00:00:00 2001 From: cfif Date: Thu, 18 Dec 2025 16:11:15 +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 | 17 +++++++++++++++++ CommandLines.h | 4 ++++ 2 files changed, 21 insertions(+) diff --git a/CommandLines.c b/CommandLines.c index 5724e45..28b182a 100644 --- a/CommandLines.c +++ b/CommandLines.c @@ -17,6 +17,7 @@ int32_t CliCmd_baseCommandHelp(void *env, tCliCmd *cli) { CliCmd_PrintLnStatic(cli, ""); CliCmd_PrintLnStatic(cli, "reboot - Restarting the device"); CliCmd_PrintLnStatic(cli, "mem - Memory Information"); + CliCmd_PrintLnStatic(cli, "set_Amb_Fb - Enter set_Amb_Fb"); CliCmd_PrintLnStatic(cli, "================================================"); return 0; @@ -29,7 +30,20 @@ int32_t CliCmd_baseCommandReboot(void *env, tCliCmd *cli) { return 0; } +int32_t CliCmd_set_Amb_Fb(tCommandLine *env, tCliCmd *cli) { + char str[64]; + CliCmd_PrintLnStatic(cli, "Enter temp: "); + CliCmd_WaitLine(cli); + + char *end; + env->data.Amb_Fb = strtol(cli->rxLine.data, &end, 10); + + sprintf(str, "Amb_Fb = %lu\n\r", env->data.Amb_Fb); + CliCmd_Print(cli, str, strlen(str)); + + return 0; +} void CommandLine_Init(tCommandLine *env, tSerialPortIO *cliVirtualPortIn_Io, tSerialPortIO *cliVirtualPortOut_Io) { @@ -39,6 +53,9 @@ void CommandLine_Init(tCommandLine *env, tSerialPortIO *cliVirtualPortIn_Io, tSe CliRedirectionTable_RecAddStatic(&env->redirectTable, "help", CliCmd_baseCommandHelp, NULL); CliRedirectionTable_RecAddStatic(&env->redirectTable, "mem", vTaskGetRunTime, NULL); CliRedirectionTable_RecAddStatic(&env->redirectTable, "reboot", CliCmd_baseCommandReboot, NULL); + CliRedirectionTable_RecAddStatic(&env->redirectTable, "set_Amb_Fb", CliCmd_set_Amb_Fb, env); + + InitThreadAtrStatic(&env->thread.attr, "CommandLine", env->thread.controlBlock, env->thread.stack, osPriorityNormal); diff --git a/CommandLines.h b/CommandLines.h index 8993dbe..95bdedb 100644 --- a/CommandLines.h +++ b/CommandLines.h @@ -28,6 +28,10 @@ typedef struct { osThreadAttr_t attr; } thread; + struct { + uint32_t Amb_Fb; + } data; + } tCommandLine; int32_t vTaskGetRunTime(void *env, tCliCmd *cli);