Make mbedTLS heap size configurable. (#1506)

This commit is contained in:
Robert Lubos
2017-03-23 01:44:24 -07:00
committed by Jonathan Hui
parent e01e3c505e
commit 4fae0c248a
3 changed files with 22 additions and 2 deletions
@@ -115,4 +115,12 @@
*/
#define SETTINGS_CONFIG_PAGE_NUM 4
/**
* @def OPENTHREAD_CONFIG_MBEDTLS_HEAP_SIZE
*
* The size of mbedTLS heap buffer when DTLS is enabled.
*
*/
#define OPENTHREAD_CONFIG_MBEDTLS_HEAP_SIZE (4096 * sizeof(void *))
#endif // OPENTHREAD_CORE_NRF52840_CONFIG_H_
+4 -2
View File
@@ -40,6 +40,8 @@
#include <openthread-config.h>
#endif
#include <openthread-core-config.h>
#include <mbedtls/memory_buffer_alloc.h>
namespace Thread {
@@ -62,9 +64,9 @@ public:
enum
{
#if OPENTHREAD_ENABLE_DTLS
kMemorySize = 2048 * sizeof(void *), ///< Size of memory buffer (bytes).
kMemorySize = OPENTHREAD_CONFIG_MBEDTLS_HEAP_SIZE, ///< Size of memory buffer (bytes).
#else
kMemorySize = 384, ///< Size of memory buffer (bytes).
kMemorySize = 384, ///< Size of memory buffer (bytes).
#endif
};
+10
View File
@@ -677,4 +677,14 @@
#define OPENTHREAD_CONFIG_ENABLE_AUTO_START_SUPPORT 1
#endif
/**
* @def OPENTHREAD_CONFIG_MBEDTLS_HEAP_SIZE
*
* The size of mbedTLS heap buffer when DTLS is enabled.
*
*/
#ifndef OPENTHREAD_CONFIG_MBEDTLS_HEAP_SIZE
#define OPENTHREAD_CONFIG_MBEDTLS_HEAP_SIZE (2048 * sizeof(void *))
#endif
#endif // OPENTHREAD_CORE_DEFAULT_CONFIG_H_