Skip to content

Added json options for nanostack heap statictics #7414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions features/nanostack/mbed-mesh-api/mbed_lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
"help": "Use `malloc()` for reserving the Nanostack's internal heap.",
"value": false
},
"heap-stat-info": {
"help": "Pointer to heap statistics `mem_stat_t` storage.",
"value": "NULL"
},
"heap-stat-info-definition": {
"help": "Definition of heap statistics `mem_stat_t` storage.",
"value": null
},
"6lowpan-nd-channel-mask": {
"help": "Channel mask, bit-mask of channels to use. [0-0x07fff800]",
"value": "0x7fff800"
Expand Down
5 changes: 4 additions & 1 deletion features/nanostack/mbed-mesh-api/source/mesh_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ static uint8_t app_stack_heap[MBED_CONF_MBED_MESH_API_HEAP_SIZE + 1];
static uint8_t *app_stack_heap;
#endif
static bool mesh_initialized = false;
#ifdef MBED_CONF_MBED_MESH_API_HEAP_STAT_INFO_DEFINITION
MBED_CONF_MBED_MESH_API_HEAP_STAT_INFO_DEFINITION;
#endif

/*
* Heap error handler, called when heap problem is detected.
Expand Down Expand Up @@ -66,7 +69,7 @@ void mesh_system_init(void)
MBED_ASSERT(app_stack_heap);
#endif
ns_hal_init(app_stack_heap, MBED_CONF_MBED_MESH_API_HEAP_SIZE,
mesh_system_heap_error_handler, NULL);
mesh_system_heap_error_handler, MBED_CONF_MBED_MESH_API_HEAP_STAT_INFO);
eventOS_scheduler_mutex_wait();
net_init_core();
eventOS_scheduler_mutex_release();
Expand Down