Skip to content

Commit cbe6f68

Browse files
author
Zhou Xiao
committed
fix(ble): ensure ble controller disable safety for ESP32-C2
1 parent 7b1a7cc commit cbe6f68

File tree

1 file changed

+4
-5
lines changed
  • components/bt/controller/esp32c2

1 file changed

+4
-5
lines changed

components/bt/controller/esp32c2/bt.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ extern void esp_panic_handler_feed_wdts(void);
141141
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
142142
extern int ble_controller_deinit(void);
143143
extern int ble_controller_enable(uint8_t mode);
144-
extern int ble_controller_disable(void);
144+
extern void ble_controller_disable(void);
145145
extern int esp_register_ext_funcs (struct ext_funcs_t *);
146146
extern void esp_unregister_ext_funcs (void);
147147
extern int esp_ble_ll_set_public_addr(const uint8_t *addr);
@@ -1077,9 +1077,9 @@ esp_err_t esp_bt_controller_disable(void)
10771077
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "invalid controller state");
10781078
return ESP_FAIL;
10791079
}
1080-
if (ble_controller_disable() != 0) {
1081-
return ESP_FAIL;
1082-
}
1080+
ble_controller_status = ESP_BT_CONTROLLER_STATUS_INITED;
1081+
1082+
ble_controller_disable();
10831083
ble_stack_disable();
10841084
if (s_ble_active) {
10851085
esp_phy_disable(PHY_MODEM_BT);
@@ -1091,7 +1091,6 @@ esp_err_t esp_bt_controller_disable(void)
10911091
#if CONFIG_SW_COEXIST_ENABLE
10921092
coex_disable();
10931093
#endif
1094-
ble_controller_status = ESP_BT_CONTROLLER_STATUS_INITED;
10951094
return ESP_OK;
10961095
}
10971096

0 commit comments

Comments
 (0)