Skip to content

Commit 9724ddc

Browse files
geza-pycompeter-pycom
authored andcommitted
Fix an issue that Bluetooth init() failed after deinit()
1 parent dd3db53 commit 9724ddc

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

esp32/mods/modbt.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,12 +1067,9 @@ static void gatts_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_
10671067
/// \class Bluetooth
10681068
static mp_obj_t bt_init_helper(bt_obj_t *self, const mp_arg_val_t *args) {
10691069
if (!self->init) {
1070-
if (!self->controller_active) {
1071-
esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
1072-
esp_bt_controller_init(&bt_cfg);
1073-
self->controller_active = true;
1074-
}
10751070

1071+
esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
1072+
esp_bt_controller_init(&bt_cfg);
10761073
esp_bt_controller_enable(ESP_BT_MODE_BLE);
10771074

10781075
if (ESP_OK != esp_bluedroid_init()) {

0 commit comments

Comments
 (0)