mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix SPP init deynamic memory bugs
This commit is contained in:
parent
c33fc7821a
commit
25774f41db
@ -43,15 +43,22 @@
|
||||
* between BTA_JvEnable and BTA_JvDisable
|
||||
* p_bta_jv_cfg->p_sdp_raw_data can be allocated before calling BTA_JvStartDiscovery
|
||||
* it can be de-allocated after the last call to access the database */
|
||||
#if BTA_DYNAMIC_MEMORY == FALSE
|
||||
static UINT8 bta_jv_sdp_raw_data[BTA_JV_SDP_RAW_DATA_SIZE];
|
||||
static UINT8 __attribute__ ((aligned(4))) bta_jv_sdp_db_data[BTA_JV_SDP_DB_SIZE];
|
||||
#endif
|
||||
|
||||
/* JV configuration structure */
|
||||
const tBTA_JV_CFG bta_jv_cfg = {
|
||||
BTA_JV_SDP_RAW_DATA_SIZE, /* The size of p_sdp_raw_data */
|
||||
BTA_JV_SDP_DB_SIZE, /* The size of p_sdp_db_data */
|
||||
bta_jv_sdp_raw_data, /* The data buffer to keep raw data */
|
||||
/* const */ tBTA_JV_CFG bta_jv_cfg = {
|
||||
BTA_JV_SDP_RAW_DATA_SIZE, /* The size of p_sdp_raw_data */
|
||||
BTA_JV_SDP_DB_SIZE, /* The size of p_sdp_db_data */
|
||||
#if BTA_DYNAMIC_MEMORY == FALSE
|
||||
bta_jv_sdp_raw_data, /* The data buffer to keep raw data */
|
||||
(tSDP_DISCOVERY_DB *)bta_jv_sdp_db_data /* The data buffer to keep SDP database */
|
||||
#else
|
||||
NULL,
|
||||
NULL
|
||||
#endif
|
||||
};
|
||||
|
||||
tBTA_JV_CFG *p_bta_jv_cfg = (tBTA_JV_CFG *) &bta_jv_cfg;
|
||||
|
@ -35,6 +35,8 @@
|
||||
|
||||
#if BTA_DYNAMIC_MEMORY == FALSE
|
||||
tBTA_JV_CB bta_jv_cb;
|
||||
#else
|
||||
tBTA_JV_CB *bta_jv_cb_ptr;
|
||||
#endif
|
||||
|
||||
/* state machine action enumeration list */
|
||||
|
@ -116,7 +116,6 @@
|
||||
|
||||
#if BTA_JV_INCLUDED==TRUE
|
||||
#include "bta_jv_int.h"
|
||||
tBTA_JV_CB *bta_jv_cb_ptr = NULL;
|
||||
#endif
|
||||
|
||||
#if BTA_HL_INCLUDED == TRUE
|
||||
@ -332,8 +331,10 @@ void BTE_DeinitStack(void)
|
||||
bta_sdp_cb_ptr = NULL;
|
||||
#endif
|
||||
#if (defined BTA_JV_INCLUDED && BTA_JV_INCLUDED == TRUE)
|
||||
osi_free(bta_jv_cb_ptr);
|
||||
bta_jv_cb_ptr = NULL;
|
||||
if (bta_jv_cb_ptr) {
|
||||
osi_free(bta_jv_cb_ptr);
|
||||
bta_jv_cb_ptr = NULL;
|
||||
}
|
||||
#endif //JV
|
||||
#if (defined BTA_HF_INCLUDED && BTA_HF_INCLUDED == TRUE)
|
||||
osi_free(bta_hf_client_cb_ptr);
|
||||
|
Loading…
Reference in New Issue
Block a user