Skip to content

Commit cec30ae

Browse files
author
Cruz Monrreal
authored
Merge pull request #7414 from mikaleppanen/nano_heap_stats_conf
Added json options for nanostack heap statictics
2 parents 4942ec5 + 46bcbf2 commit cec30ae

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

features/nanostack/mbed-mesh-api/mbed_lib.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99
"help": "Use `malloc()` for reserving the Nanostack's internal heap.",
1010
"value": false
1111
},
12+
"heap-stat-info": {
13+
"help": "Pointer to heap statistics `mem_stat_t` storage.",
14+
"value": "NULL"
15+
},
16+
"heap-stat-info-definition": {
17+
"help": "Definition of heap statistics `mem_stat_t` storage.",
18+
"value": null
19+
},
1220
"6lowpan-nd-channel-mask": {
1321
"help": "Channel mask, bit-mask of channels to use. [0-0x07fff800]",
1422
"value": "0x7fff800"

features/nanostack/mbed-mesh-api/source/mesh_system.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ static uint8_t app_stack_heap[MBED_CONF_MBED_MESH_API_HEAP_SIZE + 1];
3636
static uint8_t *app_stack_heap;
3737
#endif
3838
static bool mesh_initialized = false;
39+
#ifdef MBED_CONF_MBED_MESH_API_HEAP_STAT_INFO_DEFINITION
40+
MBED_CONF_MBED_MESH_API_HEAP_STAT_INFO_DEFINITION;
41+
#endif
3942

4043
/*
4144
* Heap error handler, called when heap problem is detected.
@@ -66,7 +69,7 @@ void mesh_system_init(void)
6669
MBED_ASSERT(app_stack_heap);
6770
#endif
6871
ns_hal_init(app_stack_heap, MBED_CONF_MBED_MESH_API_HEAP_SIZE,
69-
mesh_system_heap_error_handler, NULL);
72+
mesh_system_heap_error_handler, MBED_CONF_MBED_MESH_API_HEAP_STAT_INFO);
7073
eventOS_scheduler_mutex_wait();
7174
net_init_core();
7275
eventOS_scheduler_mutex_release();

0 commit comments

Comments
 (0)