Skip to content

Commit d3f34d7

Browse files
committed
Add config to use mbedtls and esp_timer
1 parent 8c1bcc9 commit d3f34d7

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/nimble/porting/npl/freertos/include/nimble/nimble_npl_os.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,9 @@ static inline bool ble_npl_hw_is_in_critical(void)
422422
#include "freertos/semphr.h"
423423
#include "freertos/task.h"
424424
#include "freertos/timers.h"
425+
#ifdef CONFIG_BT_NIMBLE_USE_ESP_TIMER
426+
#include "esp_timer.h"
427+
#endif
425428

426429
#ifdef __cplusplus
427430
extern "C" {

src/nimconfig.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,12 @@
165165
*/
166166
// #define CONFIG_NIMBLE_CPP_ADDR_FMT_UPPERCASE 1
167167

168+
/**
169+
* @brief Un-comment to use mbedtls instead of tinycrypt.
170+
* @details This could save approximately 8k of flash if already using mbedtls for other functionality.
171+
*/
172+
// #define CONFIG_BT_NIMBLE_CRYPTO_STACK_MBEDTLS 1
173+
168174
/**********************************
169175
End Arduino user-config
170176
**********************************/
@@ -291,6 +297,14 @@
291297
#define CONFIG_BT_CONTROLLER_ENABLED 1
292298
#endif
293299

300+
#ifndef CONFIG_BT_NIMBLE_CRYPTO_STACK_MBEDTLS
301+
#define CONFIG_BT_NIMBLE_CRYPTO_STACK_MBEDTLS 0
302+
#endif
303+
304+
#ifndef MYNEWT_VAL_BLE_CRYPTO_STACK_MBEDTLS
305+
#define MYNEWT_VAL_BLE_CRYPTO_STACK_MBEDTLS (CONFIG_BT_NIMBLE_CRYPTO_STACK_MBEDTLS)
306+
#endif
307+
294308
#ifdef ESP_PLATFORM
295309
#ifndef CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY
296310
#define CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY
@@ -325,6 +339,11 @@
325339
# error Extended advertising is not supported on ESP32.
326340
# endif
327341
#endif
342+
343+
#ifndef CONFIG_BT_NIMBLE_USE_ESP_TIMER
344+
#define CONFIG_BT_NIMBLE_USE_ESP_TIMER 1
345+
#endif
346+
328347
#endif // ESP_PLATFORM
329348

330349
#if CONFIG_BT_NIMBLE_ENABLE_PERIODIC_ADV && !CONFIG_BT_NIMBLE_EXT_ADV

0 commit comments

Comments
 (0)