Skip to content

Commit

Permalink
Fix an issue that Bluetooth init() failed after deinit()
Browse files Browse the repository at this point in the history
  • Loading branch information
geza-pycom authored and peter-pycom committed Dec 28, 2020
1 parent 8340e1e commit 3f690a5
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions esp32/mods/modbt.c
Expand Up @@ -1062,12 +1062,9 @@ static void gatts_event_handler(esp_gatts_cb_event_t event, esp_gatt_if_t gatts_
/// \class Bluetooth
static mp_obj_t bt_init_helper(bt_obj_t *self, const mp_arg_val_t *args) {
if (!self->init) {
if (!self->controller_active) {
esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
esp_bt_controller_init(&bt_cfg);
self->controller_active = true;
}

esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
esp_bt_controller_init(&bt_cfg);
esp_bt_controller_enable(ESP_BT_MODE_BLE);

if (ESP_OK != esp_bluedroid_init()) {
Expand Down

0 comments on commit 3f690a5

Please sign in to comment.