mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 18:57:19 +02:00
component/bt: allow adv stop again when adv is already stoped and fix crash when tx prog sometimes
This commit is contained in:
Submodule components/bt/controller/lib updated: 7fe0f40390...5a2416f8b8
@ -591,7 +591,7 @@ tBTM_STATUS BTM_BleBroadcast(BOOLEAN start, tBTM_START_STOP_ADV_CMPL_CBACK *p_s
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (start && p_cb->adv_mode == BTM_BLE_ADV_DISABLE) {
|
if (start) {
|
||||||
/* update adv params */
|
/* update adv params */
|
||||||
if (!btsnd_hcic_ble_write_adv_params ((UINT16)(p_cb->adv_interval_min ? p_cb->adv_interval_min :
|
if (!btsnd_hcic_ble_write_adv_params ((UINT16)(p_cb->adv_interval_min ? p_cb->adv_interval_min :
|
||||||
BTM_BLE_GAP_ADV_INT),
|
BTM_BLE_GAP_ADV_INT),
|
||||||
@ -611,19 +611,13 @@ tBTM_STATUS BTM_BleBroadcast(BOOLEAN start, tBTM_START_STOP_ADV_CMPL_CBACK *p_s
|
|||||||
}
|
}
|
||||||
|
|
||||||
status = btm_ble_start_adv ();
|
status = btm_ble_start_adv ();
|
||||||
} else if (!start && p_cb->adv_mode == BTM_BLE_ADV_ENABLE) {
|
} else {
|
||||||
//save the stop adv callback to the BTM env.
|
//save the stop adv callback to the BTM env.
|
||||||
p_cb->p_stop_adv_cb = p_stop_adv_cback;
|
p_cb->p_stop_adv_cb = p_stop_adv_cback;
|
||||||
status = btm_ble_stop_adv();
|
status = btm_ble_stop_adv();
|
||||||
#if BLE_PRIVACY_SPT == TRUE
|
#if BLE_PRIVACY_SPT == TRUE
|
||||||
btm_ble_disable_resolving_list(BTM_BLE_RL_ADV, TRUE);
|
btm_ble_disable_resolving_list(BTM_BLE_RL_ADV, TRUE);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
|
||||||
/*
|
|
||||||
1. start adv when adv has already started (not used)
|
|
||||||
2. stop adv shen adv has already stoped
|
|
||||||
*/
|
|
||||||
status = BTM_SUCCESS;
|
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
@ -3955,7 +3949,7 @@ tBTM_STATUS btm_ble_stop_adv(void)
|
|||||||
{
|
{
|
||||||
tBTM_BLE_INQ_CB *p_cb = &btm_cb.ble_ctr_cb.inq_var;
|
tBTM_BLE_INQ_CB *p_cb = &btm_cb.ble_ctr_cb.inq_var;
|
||||||
tBTM_STATUS rt = BTM_SUCCESS;
|
tBTM_STATUS rt = BTM_SUCCESS;
|
||||||
if (p_cb->adv_mode == BTM_BLE_ADV_ENABLE) {
|
if (p_cb) {
|
||||||
osi_mutex_lock(&adv_enable_lock, OSI_MUTEX_MAX_TIMEOUT);
|
osi_mutex_lock(&adv_enable_lock, OSI_MUTEX_MAX_TIMEOUT);
|
||||||
UINT8 temp_adv_mode = p_cb->adv_mode;
|
UINT8 temp_adv_mode = p_cb->adv_mode;
|
||||||
BOOLEAN temp_fast_adv_on = p_cb->fast_adv_on;
|
BOOLEAN temp_fast_adv_on = p_cb->fast_adv_on;
|
||||||
|
@ -78,7 +78,7 @@ CONFIG_LWIP_ETHARP_TRUST_IP_MAC=
|
|||||||
|
|
||||||
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
|
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
|
||||||
CONFIG_ESPTOOLPY_FLASHFREQ_40M=y
|
CONFIG_ESPTOOLPY_FLASHFREQ_40M=y
|
||||||
CONFIG_LWIP_IRAM_OPTIMIZATION=y
|
CONFIG_LWIP_IRAM_OPTIMIZATION=n
|
||||||
|
|
||||||
CONFIG_PARTITION_TABLE_CUSTOM=y
|
CONFIG_PARTITION_TABLE_CUSTOM=y
|
||||||
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
|
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
|
||||||
|
Reference in New Issue
Block a user