Обновление
This commit is contained in:
parent
668a51b6bf
commit
3565c29895
|
|
@ -30,6 +30,8 @@ typedef struct {
|
||||||
|
|
||||||
} tCommandLine;
|
} tCommandLine;
|
||||||
|
|
||||||
|
void vTaskGetRunTime(void *env, tCliCmd *cli);
|
||||||
|
|
||||||
void CommandLine_Init(tCommandLine *env, tSerialPortIO *cliVirtualPortIn_Io, tSerialPortIO *cliVirtualPortOut_Io);
|
void CommandLine_Init(tCommandLine *env, tSerialPortIO *cliVirtualPortIn_Io, tSerialPortIO *cliVirtualPortOut_Io);
|
||||||
void CommandLine_StartThread(tCommandLine *env);
|
void CommandLine_StartThread(tCommandLine *env);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
//
|
||||||
|
// Created by cfif on 17.12.2024.
|
||||||
|
//
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include "CliRedirectTable.h"
|
||||||
|
#include "CmsisRtosThreadUtils.h"
|
||||||
|
|
||||||
|
char bufSprintf[1024];
|
||||||
|
|
||||||
|
int32_t vTaskGetRunTime(void *env, tCliCmd *cli) {
|
||||||
|
|
||||||
|
volatile UBaseType_t uxArraySize, x;
|
||||||
|
|
||||||
|
uxArraySize = uxTaskGetNumberOfTasks();
|
||||||
|
|
||||||
|
TaskStatus_t pxTaskStatusArray[uxArraySize];
|
||||||
|
|
||||||
|
|
||||||
|
uxArraySize = uxTaskGetSystemState((void *) pxTaskStatusArray, uxArraySize, NULL);
|
||||||
|
|
||||||
|
uint16_t p = 1;
|
||||||
|
bufSprintf[0] = '\n';
|
||||||
|
|
||||||
|
for (x = 0; x < uxArraySize; x++) {
|
||||||
|
|
||||||
|
sprintf(&bufSprintf[p], "%lu\t%d\t%s\n",
|
||||||
|
pxTaskStatusArray[x].xTaskNumber,
|
||||||
|
pxTaskStatusArray[x].usStackHighWaterMark,
|
||||||
|
pxTaskStatusArray[x].pcTaskName);
|
||||||
|
|
||||||
|
p = strlen(bufSprintf);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
CliCmd_Print(cli, bufSprintf, p);
|
||||||
|
|
||||||
|
sprintf(bufSprintf, "Free Heap Size = %u bytes\n", (unsigned int)xPortGetFreeHeapSize());
|
||||||
|
p = strlen(bufSprintf);
|
||||||
|
CliCmd_Print(cli, bufSprintf, p);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue