mirror of
https://github.com/espressif/esp-idf
synced 2025-03-31 03:41:07 -04:00
fix(ble/bluedroid): Fixed BLE build fail when enable dynamic memory and BLE5.0
(cherry picked from commit 94d1a4f1c009031c7623153b885f1f75b39b4555) Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
This commit is contained in:
parent
9f4b1bd471
commit
7a4d10b718
@ -382,7 +382,7 @@ static void btc_deinit_mem(void) {
|
|||||||
btc_profile_cb_tab = NULL;
|
btc_profile_cb_tab = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (BLE_INCLUDED == TRUE)
|
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||||
if (gl_bta_adv_data_ptr) {
|
if (gl_bta_adv_data_ptr) {
|
||||||
osi_free(gl_bta_adv_data_ptr);
|
osi_free(gl_bta_adv_data_ptr);
|
||||||
gl_bta_adv_data_ptr = NULL;
|
gl_bta_adv_data_ptr = NULL;
|
||||||
@ -392,7 +392,7 @@ static void btc_deinit_mem(void) {
|
|||||||
osi_free(gl_bta_scan_rsp_data_ptr);
|
osi_free(gl_bta_scan_rsp_data_ptr);
|
||||||
gl_bta_scan_rsp_data_ptr = NULL;
|
gl_bta_scan_rsp_data_ptr = NULL;
|
||||||
}
|
}
|
||||||
#endif ///BLE_INCLUDED == TRUE
|
#endif // BLE_42_FEATURE_SUPPORT
|
||||||
|
|
||||||
#if GATTS_INCLUDED == TRUE && GATT_DYNAMIC_MEMORY == TRUE
|
#if GATTS_INCLUDED == TRUE && GATT_DYNAMIC_MEMORY == TRUE
|
||||||
if (btc_creat_tab_env_ptr) {
|
if (btc_creat_tab_env_ptr) {
|
||||||
@ -444,7 +444,8 @@ static bt_status_t btc_init_mem(void) {
|
|||||||
}
|
}
|
||||||
memset((void *)btc_profile_cb_tab, 0, sizeof(void *) * BTC_PID_NUM);
|
memset((void *)btc_profile_cb_tab, 0, sizeof(void *) * BTC_PID_NUM);
|
||||||
|
|
||||||
#if (BLE_INCLUDED == TRUE)
|
#if BTC_DYNAMIC_MEMORY == TRUE
|
||||||
|
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||||
if ((gl_bta_adv_data_ptr = (tBTA_BLE_ADV_DATA *)osi_malloc(sizeof(tBTA_BLE_ADV_DATA))) == NULL) {
|
if ((gl_bta_adv_data_ptr = (tBTA_BLE_ADV_DATA *)osi_malloc(sizeof(tBTA_BLE_ADV_DATA))) == NULL) {
|
||||||
goto error_exit;
|
goto error_exit;
|
||||||
}
|
}
|
||||||
@ -454,7 +455,8 @@ static bt_status_t btc_init_mem(void) {
|
|||||||
goto error_exit;
|
goto error_exit;
|
||||||
}
|
}
|
||||||
memset((void *)gl_bta_scan_rsp_data_ptr, 0, sizeof(tBTA_BLE_ADV_DATA));
|
memset((void *)gl_bta_scan_rsp_data_ptr, 0, sizeof(tBTA_BLE_ADV_DATA));
|
||||||
#endif ///BLE_INCLUDED == TRUE
|
#endif // (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||||
|
#endif // BTC_DYNAMIC_MEMORY == TRUE
|
||||||
|
|
||||||
#if GATTS_INCLUDED == TRUE && GATT_DYNAMIC_MEMORY == TRUE
|
#if GATTS_INCLUDED == TRUE && GATT_DYNAMIC_MEMORY == TRUE
|
||||||
if ((btc_creat_tab_env_ptr = (esp_btc_creat_tab_t *)osi_malloc(sizeof(esp_btc_creat_tab_t))) == NULL) {
|
if ((btc_creat_tab_env_ptr = (esp_btc_creat_tab_t *)osi_malloc(sizeof(esp_btc_creat_tab_t))) == NULL) {
|
||||||
|
@ -11,11 +11,13 @@
|
|||||||
#include "esp_gap_ble_api.h"
|
#include "esp_gap_ble_api.h"
|
||||||
|
|
||||||
#if BTC_DYNAMIC_MEMORY == TRUE
|
#if BTC_DYNAMIC_MEMORY == TRUE
|
||||||
|
#if (BLE_42_FEATURE_SUPPORT == TRUE)
|
||||||
#include "bta/bta_api.h"
|
#include "bta/bta_api.h"
|
||||||
extern tBTA_BLE_ADV_DATA *gl_bta_adv_data_ptr;
|
extern tBTA_BLE_ADV_DATA *gl_bta_adv_data_ptr;
|
||||||
extern tBTA_BLE_ADV_DATA *gl_bta_scan_rsp_data_ptr;
|
extern tBTA_BLE_ADV_DATA *gl_bta_scan_rsp_data_ptr;
|
||||||
#define gl_bta_adv_data (*gl_bta_adv_data_ptr)
|
#define gl_bta_adv_data (*gl_bta_adv_data_ptr)
|
||||||
#define gl_bta_scan_rsp_data (*gl_bta_scan_rsp_data_ptr)
|
#define gl_bta_scan_rsp_data (*gl_bta_scan_rsp_data_ptr)
|
||||||
|
#endif // BLE_42_FEATURE_SUPPORT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BLE_ISVALID_PARAM(x, min, max) (((x) >= (min) && (x) <= (max)))
|
#define BLE_ISVALID_PARAM(x, min, max) (((x) >= (min) && (x) <= (max)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user