Skip to content

Commit

Permalink
Fixed task watchdog trigger issue when closed hci uart
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoweiliang2021 committed Jan 4, 2023
1 parent 2819f9a commit 98c4872
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/bt/porting/transport/uart/hci_uart.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -176,9 +176,12 @@ int hci_uart_init_cbs(int port_num, hci_uart_tx_char tx_func,

int hci_uart_close(int port_num)
{
uart_event_t uart_event;
uart_event.type = UART_BREAK;
hci_uart.uart_opened = false;
// Stop uart rx task
if (hci_uart.rx_task_handler != NULL) {
xQueueSend(hci_uart.evt_queue, (void *)&uart_event, 1000);
ESP_LOGW(TAG, "Waiting for uart task finish...");
}
while (hci_uart.rx_task_handler != NULL);
Expand Down

0 comments on commit 98c4872

Please sign in to comment.