Обновление
This commit is contained in:
parent
ea6ab86ba7
commit
49d80b9fbd
|
|
@ -26,13 +26,13 @@ int32_t CliCmd_baseCommandReboot(void *env, tCliCmd *cli) {
|
||||||
return 0;
|
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_InitStatic(&env->redirectTable, env->mem.commandPrefixes);
|
||||||
|
|
||||||
CliRedirectionTable_RecAddStatic(&env->redirectTable, "help", (cliCall) CliCmd_baseCommandHelp, NULL);
|
CliRedirectionTable_RecAddStatic(&env->redirectTable, "help\n", (cliCall) CliCmd_baseCommandHelp, NULL);
|
||||||
CliRedirectionTable_RecAddStatic(&env->redirectTable, "reboot", (cliCall) CliCmd_baseCommandReboot, NULL);
|
CliRedirectionTable_RecAddStatic(&env->redirectTable, "reboot\n", (cliCall) CliCmd_baseCommandReboot, NULL);
|
||||||
|
|
||||||
InitThreadAtrStatic(&env->thread.attr, "CommandLine", env->thread.controlBlock, env->thread.stack,
|
InitThreadAtrStatic(&env->thread.attr, "CommandLine", env->thread.controlBlock, env->thread.stack,
|
||||||
osPriorityNormal);
|
osPriorityNormal);
|
||||||
|
|
@ -44,9 +44,6 @@ void ListenCLICommand(tCommandLine *env) {
|
||||||
CliCmd_PrintStatic(&env->cmd, "Command ");
|
CliCmd_PrintStatic(&env->cmd, "Command ");
|
||||||
CliCmd_Print(&env->cmd, env->cmd.rxLine.begin, env->cmd.rxLine.length - 1);
|
CliCmd_Print(&env->cmd, env->cmd.rxLine.begin, env->cmd.rxLine.length - 1);
|
||||||
CliCmd_PrintLnStatic(&env->cmd, " not found");
|
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");
|
CliCmd_PrintLnStatic(&env->cmd, "Enter the command [ help ] for more information\n");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ typedef struct {
|
||||||
|
|
||||||
} tCommandLine;
|
} tCommandLine;
|
||||||
|
|
||||||
void CommandLine_Init(tCommandLine *env, tSerialPortIO *serial);
|
void CommandLine_Init(tCommandLine *env, tSerialPortIO *cliVirtualPortIn_Io, tSerialPortIO *cliVirtualPortOut_Io);
|
||||||
void CommandLine_StartThread(tCommandLine *env);
|
void CommandLine_StartThread(tCommandLine *env);
|
||||||
|
|
||||||
#endif //WATER_BLACKBOX2_G_COMMANDLINES_H
|
#endif //WATER_BLACKBOX2_G_COMMANDLINES_H
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue