mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 12:14:32 +02:00
fix SPP init deynamic memory bugs
This commit is contained in:
@@ -43,15 +43,22 @@
|
|||||||
* between BTA_JvEnable and BTA_JvDisable
|
* between BTA_JvEnable and BTA_JvDisable
|
||||||
* p_bta_jv_cfg->p_sdp_raw_data can be allocated before calling BTA_JvStartDiscovery
|
* 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 */
|
* 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 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];
|
static UINT8 __attribute__ ((aligned(4))) bta_jv_sdp_db_data[BTA_JV_SDP_DB_SIZE];
|
||||||
|
#endif
|
||||||
|
|
||||||
/* JV configuration structure */
|
/* JV configuration structure */
|
||||||
const tBTA_JV_CFG bta_jv_cfg = {
|
/* const */ tBTA_JV_CFG bta_jv_cfg = {
|
||||||
BTA_JV_SDP_RAW_DATA_SIZE, /* The size of p_sdp_raw_data */
|
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_DB_SIZE, /* The size of p_sdp_db_data */
|
||||||
bta_jv_sdp_raw_data, /* The data buffer to keep raw 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 */
|
(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;
|
tBTA_JV_CFG *p_bta_jv_cfg = (tBTA_JV_CFG *) &bta_jv_cfg;
|
||||||
|
@@ -35,6 +35,8 @@
|
|||||||
|
|
||||||
#if BTA_DYNAMIC_MEMORY == FALSE
|
#if BTA_DYNAMIC_MEMORY == FALSE
|
||||||
tBTA_JV_CB bta_jv_cb;
|
tBTA_JV_CB bta_jv_cb;
|
||||||
|
#else
|
||||||
|
tBTA_JV_CB *bta_jv_cb_ptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* state machine action enumeration list */
|
/* state machine action enumeration list */
|
||||||
|
@@ -116,7 +116,6 @@
|
|||||||
|
|
||||||
#if BTA_JV_INCLUDED==TRUE
|
#if BTA_JV_INCLUDED==TRUE
|
||||||
#include "bta_jv_int.h"
|
#include "bta_jv_int.h"
|
||||||
tBTA_JV_CB *bta_jv_cb_ptr = NULL;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if BTA_HL_INCLUDED == TRUE
|
#if BTA_HL_INCLUDED == TRUE
|
||||||
@@ -332,8 +331,10 @@ void BTE_DeinitStack(void)
|
|||||||
bta_sdp_cb_ptr = NULL;
|
bta_sdp_cb_ptr = NULL;
|
||||||
#endif
|
#endif
|
||||||
#if (defined BTA_JV_INCLUDED && BTA_JV_INCLUDED == TRUE)
|
#if (defined BTA_JV_INCLUDED && BTA_JV_INCLUDED == TRUE)
|
||||||
osi_free(bta_jv_cb_ptr);
|
if (bta_jv_cb_ptr) {
|
||||||
bta_jv_cb_ptr = NULL;
|
osi_free(bta_jv_cb_ptr);
|
||||||
|
bta_jv_cb_ptr = NULL;
|
||||||
|
}
|
||||||
#endif //JV
|
#endif //JV
|
||||||
#if (defined BTA_HF_INCLUDED && BTA_HF_INCLUDED == TRUE)
|
#if (defined BTA_HF_INCLUDED && BTA_HF_INCLUDED == TRUE)
|
||||||
osi_free(bta_hf_client_cb_ptr);
|
osi_free(bta_hf_client_cb_ptr);
|
||||||
|
Reference in New Issue
Block a user