[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>
This commit is contained in:
gornekich
2021-09-16 19:12:07 +03:00
committed by GitHub
parent b4ffc1f81b
commit f05153ed5c
10 changed files with 125 additions and 44 deletions

View File

@@ -155,19 +155,21 @@ void memmgr_heap_disable_thread_trace(osThreadId_t thread_id) {
}
size_t memmgr_heap_get_thread_memory(osThreadId_t thread_id) {
size_t leftovers = 0;
size_t leftovers = MEMMGR_HEAP_UNKNOWN;
vTaskSuspendAll();
{
memmgr_heap_thread_trace_depth++;
MemmgrHeapAllocDict_t* alloc_dict =
MemmgrHeapThreadDict_get(memmgr_heap_thread_dict, (uint32_t)thread_id);
furi_check(alloc_dict);
MemmgrHeapAllocDict_it_t alloc_dict_it;
for(MemmgrHeapAllocDict_it(alloc_dict_it, *alloc_dict);
!MemmgrHeapAllocDict_end_p(alloc_dict_it);
MemmgrHeapAllocDict_next(alloc_dict_it)) {
MemmgrHeapAllocDict_itref_t* data = MemmgrHeapAllocDict_ref(alloc_dict_it);
leftovers += data->value;
if(alloc_dict) {
leftovers = 0;
MemmgrHeapAllocDict_it_t alloc_dict_it;
for(MemmgrHeapAllocDict_it(alloc_dict_it, *alloc_dict);
!MemmgrHeapAllocDict_end_p(alloc_dict_it);
MemmgrHeapAllocDict_next(alloc_dict_it)) {
MemmgrHeapAllocDict_itref_t* data = MemmgrHeapAllocDict_ref(alloc_dict_it);
leftovers += data->value;
}
}
memmgr_heap_thread_trace_depth--;
}

View File

@@ -7,6 +7,8 @@
extern "C" {
#endif
#define MEMMGR_HEAP_UNKNOWN 0xFFFFFFFF
/** Memmgr heap enable thread allocation tracking
* @param thread_id - thread id to track
*/