Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit 3f690a5

Browse files
geza-pycompeter-pycom
authored andcommitted
Fix an issue that Bluetooth init() failed after deinit()
1 parent 8340e1e commit 3f690a5

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

esp32/mods/modbt.c

+2-5
Original file line numberDiff line numberDiff line change
@@ -1062,12 +1062,9 @@ static void gatts_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_
10621062
/// \class Bluetooth
10631063
static mp_obj_t bt_init_helper(bt_obj_t *self, const mp_arg_val_t *args) {
10641064
if (!self->init) {
1065-
if (!self->controller_active) {
1066-
esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
1067-
esp_bt_controller_init(&bt_cfg);
1068-
self->controller_active = true;
1069-
}
10701065

1066+
esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
1067+
esp_bt_controller_init(&bt_cfg);
10711068
esp_bt_controller_enable(ESP_BT_MODE_BLE);
10721069

10731070
if (ESP_OK != esp_bluedroid_init()) {

0 commit comments

Comments
 (0)