Обновление

This commit is contained in:
cfif 2025-12-09 17:09:13 +03:00
parent ea6ab86ba7
commit 49d80b9fbd
2 changed files with 5 additions and 8 deletions

View File

@ -26,13 +26,13 @@ int32_t CliCmd_baseCommandReboot(void *env, tCliCmd *cli) {
return 0;
}
void CommandLine_Init(tCommandLine *env, tSerialPortIO *serial) {
void CommandLine_Init(tCommandLine *env, tSerialPortIO *cliVirtualPortIn_Io, tSerialPortIO *cliVirtualPortOut_Io) {
CliCmd_InitStatic(&env->cmd, serial, env->mem.cmdRxLine);
CliCmd_InitStatic(&env->cmd, cliVirtualPortIn_Io, cliVirtualPortOut_Io, env->mem.cmdRxLine);
CliRedirectionTable_InitStatic(&env->redirectTable, env->mem.commandPrefixes);
CliRedirectionTable_RecAddStatic(&env->redirectTable, "help", (cliCall) CliCmd_baseCommandHelp, NULL);
CliRedirectionTable_RecAddStatic(&env->redirectTable, "reboot", (cliCall) CliCmd_baseCommandReboot, NULL);
CliRedirectionTable_RecAddStatic(&env->redirectTable, "help\n", (cliCall) CliCmd_baseCommandHelp, NULL);
CliRedirectionTable_RecAddStatic(&env->redirectTable, "reboot\n", (cliCall) CliCmd_baseCommandReboot, NULL);
InitThreadAtrStatic(&env->thread.attr, "CommandLine", env->thread.controlBlock, env->thread.stack,
osPriorityNormal);
@ -44,9 +44,6 @@ void ListenCLICommand(tCommandLine *env) {
CliCmd_PrintStatic(&env->cmd, "Command ");
CliCmd_Print(&env->cmd, env->cmd.rxLine.begin, env->cmd.rxLine.length - 1);
CliCmd_PrintLnStatic(&env->cmd, " not found");
CliCmd_PrintStatic(&env->cmd, "use ");
CliRedirectionTable_ListCmd(&env->redirectTable, &env->cmd, ' ');
CliCmd_PrintLnStatic(&env->cmd, "");
CliCmd_PrintLnStatic(&env->cmd, "Enter the command [ help ] for more information\n");

View File

@ -30,7 +30,7 @@ typedef struct {
} tCommandLine;
void CommandLine_Init(tCommandLine *env, tSerialPortIO *serial);
void CommandLine_Init(tCommandLine *env, tSerialPortIO *cliVirtualPortIn_Io, tSerialPortIO *cliVirtualPortOut_Io);
void CommandLine_StartThread(tCommandLine *env);
#endif //WATER_BLACKBOX2_G_COMMANDLINES_H