[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:
@@ -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--;
|
||||
}
|
||||
|
@@ -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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user