diff options
author | gornekich <n.gorbadey@gmail.com> | 2021-09-16 19:12:07 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-16 19:12:07 +0300 |
commit | f05153ed5c2e8dc54f64c238f3c0a63dc4aa836d (patch) | |
tree | 90c318fd24ac4227144e36a48819c175c30b6afc /applications/cli | |
parent | b4ffc1f81b264a2a47e8943aad2c1b8730f18133 (diff) |
[FL-1816] Fix ble radio stack is alive check (#707)
* bt: fix bt_is_alive return, add bt_is_active
* bt: fix bt_is_alive return
* Cli: show heap usage in ps.
* FuriHal: strict sequence for flash operations
* Scripts: add stress test
* Core: proper heap calculation.
Co-authored-by: あく <alleteam@gmail.com>
Diffstat (limited to 'applications/cli')
-rw-r--r-- | applications/cli/cli_commands.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/applications/cli/cli_commands.c b/applications/cli/cli_commands.c index 616808e0..eb459457 100644 --- a/applications/cli/cli_commands.c +++ b/applications/cli/cli_commands.c @@ -385,17 +385,19 @@ 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("%d threads in total:\r\n", thread_num); - printf("%-20s %-14s %-14s %s\r\n", "Name", "Stack start", "Stack alloc", "Stack watermark"); + printf( + "%-20s %-14s %-8s %-8s %s\r\n", "Name", "Stack start", "Heap", "Stack", "Stack min free"); for(uint8_t i = 0; i < thread_num; i++) { TaskControlBlock* tcb = (TaskControlBlock*)threads_id[i]; printf( - "%-20s 0x%-12lx %-14ld %ld\r\n", + "%-20s 0x%-12lx %-8d %-8ld %-8ld\r\n", osThreadGetName(threads_id[i]), (uint32_t)tcb->pxStack, - (uint32_t)(tcb->pxEndOfStack - tcb->pxStack + 1) * sizeof(uint32_t), - osThreadGetStackSpace(threads_id[i]) * sizeof(uint32_t)); + memmgr_heap_get_thread_memory(threads_id[i]), + (uint32_t)(tcb->pxEndOfStack - tcb->pxStack + 1) * sizeof(StackType_t), + osThreadGetStackSpace(threads_id[i])); } + printf("\r\nTotal: %d", thread_num); } void cli_command_free(Cli* cli, string_t args, void* context) { |