Обновление
This commit is contained in:
parent
7c23f431ce
commit
8ac807aee6
|
|
@ -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);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -3,12 +3,15 @@
|
|||
//
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#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;
|
||||
}
|
||||
Loading…
Reference in New Issue