diff --git a/components/bt/controller/esp32c5/Kconfig.in b/components/bt/controller/esp32c5/Kconfig.in index 2982b6da8e..a95e6ef679 100644 --- a/components/bt/controller/esp32c5/Kconfig.in +++ b/components/bt/controller/esp32c5/Kconfig.in @@ -406,6 +406,12 @@ menu "Controller debug features" config BT_LE_PTR_CHECK_ENABLED bool "Enable boundary check for internal memory" default n + + config BT_LE_MEM_CHECK_ENABLED + bool "Enable memory allocation check" + default n + help + Used in internal tests only. Enable the memory allocation check. endmenu config BT_LE_LL_RESOLV_LIST_SIZE diff --git a/components/bt/controller/esp32c5/bt.c b/components/bt/controller/esp32c5/bt.c index e6070f520c..3d035ac307 100644 --- a/components/bt/controller/esp32c5/bt.c +++ b/components/bt/controller/esp32c5/bt.c @@ -1700,3 +1700,10 @@ ble_capture_info_user_handler(uint8_t type, uint32_t reason, uint32_t param1, ui } return 0; } + +#if CONFIG_BT_LE_MEM_CHECK_ENABLED +void ble_memory_count_limit_set(uint16_t count_limit) +{ + bt_osi_mem_count_limit_set(count_limit); +} +#endif // CONFIG_BT_LE_MEM_CHECK_ENABLED diff --git a/components/bt/include/esp32c5/include/esp_bt.h b/components/bt/include/esp32c5/include/esp_bt.h index ce490db77a..2d17c7cbc9 100644 --- a/components/bt/include/esp32c5/include/esp_bt.h +++ b/components/bt/include/esp32c5/include/esp_bt.h @@ -459,6 +459,10 @@ uint32_t esp_bt_get_lpclk_freq(void); void esp_bt_set_lpclk_freq(uint32_t clk_freq); +#if CONFIG_BT_LE_MEM_CHECK_ENABLED +void ble_memory_count_limit_set(uint16_t count_limit); +#endif // CONFIG_BT_LE_MEM_CHECK_ENABLED + #ifdef __cplusplus } #endif