Skip to content

Commit

Permalink
wait for BT disable to avoid crash - release
Browse files Browse the repository at this point in the history
  • Loading branch information
philippe44 committed Jul 1, 2021
1 parent 21c3ce1 commit d4f6289
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/driver_bt/bt_app_sink.c
Expand Up @@ -650,10 +650,12 @@ void bt_sink_init(bt_cmd_vcb_t cmd_cb, bt_data_cb_t data_cb)

void bt_sink_deinit(void)
{
/* this still does not work, can't figure out how to stop properly this BT stack */
bt_app_task_shut_down();
ESP_LOGD(BT_AV_TAG, "bt_app_task shutdown successfully");
if (esp_bluedroid_disable() != ESP_OK) return;
// this disable has a sleep timer BTA_DISABLE_DELAY in bt_target.h and
// if we don't wait for it then disable crashes... don't know why
vTaskDelay(2*200 / portTICK_PERIOD_MS);
ESP_LOGD(BT_AV_TAG, "esp_bluedroid_disable called successfully");
if (esp_bluedroid_deinit() != ESP_OK) return;
ESP_LOGD(BT_AV_TAG, "esp_bluedroid_deinit called successfully");
Expand Down

0 comments on commit d4f6289

Please sign in to comment.