Skip to content

Commit

Permalink
Merge pull request #27 from ARMmbed/make_heap_size_configurable
Browse files Browse the repository at this point in the history
Make nanostack heap size configurable via yotta.
  • Loading branch information
TeroJaasko committed May 24, 2016
2 parents b1b6cbf + ca78dd9 commit 341c5a0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ This module supports static configuration via [yotta configuration](#http://yott

```
"mbed-mesh-api": {
"heap_size": 32500,
"thread": {
"pskd": "\"Secret password\"",
"device_type": "MESH_DEVICE_TYPE_THREAD_ROUTER",
Expand All @@ -42,6 +43,12 @@ This module supports static configuration via [yotta configuration](#http://yott
}
```

Configurable parameters in section: mbed-mesh-api

| Parameter name | Value | Description |
| --------------- | ------------- | ----------- |
| heap_size | number [0-0xfffe] | Nanostack internal heap size |

Configurable parameters in section: mbed-mesh-api/thread

| Parameter name | Value | Description |
Expand Down
4 changes: 4 additions & 0 deletions source/mesh_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@
#define TRACE_GROUP "m6-mesh-system"

/* Heap for NanoStack */
#ifdef YOTTA_CFG_MBED_MESH_API_HEAP_SIZE
#define MESH_HEAP_SIZE YOTTA_CFG_MBED_MESH_API_HEAP_SIZE
#else
#define MESH_HEAP_SIZE 32500
#endif
static uint8_t app_stack_heap[MESH_HEAP_SIZE + 1];
static bool mesh_initialized = false;

Expand Down

0 comments on commit 341c5a0

Please sign in to comment.