Skip to content

Commit

Permalink
Add config to use mbedtls and esp_timer
Browse files Browse the repository at this point in the history
  • Loading branch information
h2zero committed Jan 12, 2025
1 parent 8c1bcc9 commit d3f34d7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,9 @@ static inline bool ble_npl_hw_is_in_critical(void)
#include "freertos/semphr.h"
#include "freertos/task.h"
#include "freertos/timers.h"
#ifdef CONFIG_BT_NIMBLE_USE_ESP_TIMER
#include "esp_timer.h"
#endif

#ifdef __cplusplus
extern "C" {
Expand Down
19 changes: 19 additions & 0 deletions src/nimconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,12 @@
*/
// #define CONFIG_NIMBLE_CPP_ADDR_FMT_UPPERCASE 1

/**
* @brief Un-comment to use mbedtls instead of tinycrypt.
* @details This could save approximately 8k of flash if already using mbedtls for other functionality.
*/
// #define CONFIG_BT_NIMBLE_CRYPTO_STACK_MBEDTLS 1

/**********************************
End Arduino user-config
**********************************/
Expand Down Expand Up @@ -291,6 +297,14 @@
#define CONFIG_BT_CONTROLLER_ENABLED 1
#endif

#ifndef CONFIG_BT_NIMBLE_CRYPTO_STACK_MBEDTLS
#define CONFIG_BT_NIMBLE_CRYPTO_STACK_MBEDTLS 0
#endif

#ifndef MYNEWT_VAL_BLE_CRYPTO_STACK_MBEDTLS
#define MYNEWT_VAL_BLE_CRYPTO_STACK_MBEDTLS (CONFIG_BT_NIMBLE_CRYPTO_STACK_MBEDTLS)
#endif

#ifdef ESP_PLATFORM
#ifndef CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY
#define CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY
Expand Down Expand Up @@ -325,6 +339,11 @@
# error Extended advertising is not supported on ESP32.
# endif
#endif

#ifndef CONFIG_BT_NIMBLE_USE_ESP_TIMER
#define CONFIG_BT_NIMBLE_USE_ESP_TIMER 1
#endif

#endif // ESP_PLATFORM

#if CONFIG_BT_NIMBLE_ENABLE_PERIODIC_ADV && !CONFIG_BT_NIMBLE_EXT_ADV
Expand Down

0 comments on commit d3f34d7

Please sign in to comment.