From 3b82670a50a3b147df906b440e0f6146e45db313 Mon Sep 17 00:00:00 2001 From: baohongde Date: Wed, 14 Oct 2020 20:20:57 +0800 Subject: [PATCH] components/bt: Fix waking up fail while sleeping --- components/bt/controller/bt.c | 12 +++--------- components/bt/controller/lib | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/components/bt/controller/bt.c b/components/bt/controller/bt.c index 9da145c03b..808d4b6f07 100644 --- a/components/bt/controller/bt.c +++ b/components/bt/controller/bt.c @@ -934,19 +934,15 @@ static void btdm_wakeup_request_callback(void * arg) static bool async_wakeup_request(int event) { - bool request_lock = false; bool do_wakeup_request = false; switch (event) { case BTDM_ASYNC_WAKEUP_REQ_HCI: - request_lock = true; + btdm_in_wakeup_requesting_set(true); // NO break case BTDM_ASYNC_WAKEUP_REQ_CTRL_DISA: if (!btdm_power_state_active()) { do_wakeup_request = true; - if (request_lock) { - btdm_in_wakeup_requesting_set(true); - } btdm_dispatch_work_to_controller(btdm_wakeup_request_callback, NULL, true); semphr_take_wrapper(s_wakeup_req_sem, OSI_FUNCS_TIME_BLOCKING); @@ -1055,13 +1051,11 @@ bool esp_vhci_host_check_send_available(void) void esp_vhci_host_send_packet(uint8_t *data, uint16_t len) { - bool do_wakeup_request = async_wakeup_request(BTDM_ASYNC_WAKEUP_REQ_HCI); + async_wakeup_request(BTDM_ASYNC_WAKEUP_REQ_HCI); API_vhci_host_send_packet(data, len); - if (do_wakeup_request) { - async_wakeup_request_end(BTDM_ASYNC_WAKEUP_REQ_HCI); - } + async_wakeup_request_end(BTDM_ASYNC_WAKEUP_REQ_HCI); } esp_err_t esp_vhci_host_register_callback(const esp_vhci_host_callback_t *callback) diff --git a/components/bt/controller/lib b/components/bt/controller/lib index 427c1a3215..448e95c108 160000 --- a/components/bt/controller/lib +++ b/components/bt/controller/lib @@ -1 +1 @@ -Subproject commit 427c1a3215bcd91ef39abc05e45be562dca4321a +Subproject commit 448e95c108ee490dbfcc69634560ced1eb148e15