Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/flipperzero-firmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSG <who.just.the.doctor@gmail.com>2021-07-05 16:01:02 +0300
committerGitHub <noreply@github.com>2021-07-05 16:01:02 +0300
commit54114553c1193bcea3c06873ca2121ad375d58de (patch)
tree767ec593e3f772b33cdfe3712fc42d5cc8311bc5 /applications/cli
parentf153a745eba650fbf199fa9d5dbcbba7c0f69012 (diff)
[FL-1517] Maximum heap block stat for os_info cli cmd. (#564)
* Memmgr: heap_get_max_free_block function. Add "Maximum heap block" to os_info cmd. * Cli: split os_info into ps and free commands Co-authored-by: あく <alleteam@gmail.com>
Diffstat (limited to 'applications/cli')
-rw-r--r--applications/cli/cli_commands.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/applications/cli/cli_commands.c b/applications/cli/cli_commands.c
index c11c40e9..2b7c70d0 100644
--- a/applications/cli/cli_commands.c
+++ b/applications/cli/cli_commands.c
@@ -354,13 +354,10 @@ void cli_command_gpio_set(Cli* cli, string_t args, void* context) {
return;
}
-void cli_command_os_info(Cli* cli, string_t args, void* context) {
+void cli_command_ps(Cli* cli, string_t args, void* context) {
const uint8_t threads_num_max = 32;
osThreadId_t threads_id[threads_num_max];
uint8_t thread_num = osThreadEnumerate(threads_id, threads_num_max);
-
- printf("Free HEAP size: %d\r\n", xPortGetFreeHeapSize());
- printf("Minimum heap size: %d\r\n", xPortGetMinimumEverFreeHeapSize());
printf("%d threads in total:\r\n", thread_num);
printf("%-20s %-14s %-14s %s\r\n", "Name", "Stack start", "Stack alloc", "Stack free");
for(uint8_t i = 0; i < thread_num; i++) {
@@ -372,7 +369,12 @@ void cli_command_os_info(Cli* cli, string_t args, void* context) {
(uint32_t)(tcb->pxEndOfStack - tcb->pxStack + 1) * sizeof(uint32_t),
osThreadGetStackSpace(threads_id[i]) * sizeof(uint32_t));
}
- return;
+}
+
+void cli_command_free(Cli* cli, string_t args, void* context) {
+ printf("Free heap size: %d\r\n", memmgr_get_free_heap());
+ printf("Minimum heap size: %d\r\n", memmgr_get_minimum_free_heap());
+ printf("Maximum heap block: %d\r\n", memmgr_heap_get_max_free_block());
}
void cli_commands_init(Cli* cli) {
@@ -387,5 +389,6 @@ void cli_commands_init(Cli* cli) {
cli_add_command(cli, "vibro", cli_command_vibro, NULL);
cli_add_command(cli, "led", cli_command_led, NULL);
cli_add_command(cli, "gpio_set", cli_command_gpio_set, NULL);
- cli_add_command(cli, "os_info", cli_command_os_info, NULL);
+ cli_add_command(cli, "ps", cli_command_ps, NULL);
+ cli_add_command(cli, "free", cli_command_free, NULL);
}