fix(nimble): De-register host cb in stack deinit

This commit is contained in:
Rahul Tank
2024-09-16 10:35:20 +05:30
parent 121739fe78
commit 81a116a815
7 changed files with 46 additions and 0 deletions
+5
View File
@@ -50,6 +50,11 @@ typedef int (*hal_uart_rx_char)(void *arg, uint8_t byte);
int hal_uart_init_cbs(int uart, hal_uart_tx_char tx_func,
hal_uart_tx_done tx_done, hal_uart_rx_char rx_func, void *arg);
/**
* De Initialize already registerd callbacks
*/
void hal_uart_deinit_cbs(void);
enum hal_uart_parity {
/** No Parity */
HAL_UART_PARITY_NONE = 0,
+8
View File
@@ -43,6 +43,14 @@ int hal_uart_init_cbs(int uart_no, hal_uart_tx_char tx_func,
return 0;
}
void hal_uart_deinit_cbs(void)
{
hci_uart.tx_char = NULL;
hci_uart.rx_char = NULL;
hci_uart.tx_done = NULL;
hci_uart.u_func_arg = NULL;
}
static void IRAM_ATTR hci_uart_rx_task(void *pvParameters)
{
uart_event_t event;
+2
View File
@@ -156,6 +156,8 @@ esp_err_t esp_nimble_deinit(void)
#if !SOC_ESP_NIMBLE_CONTROLLER || !CONFIG_BT_CONTROLLER_ENABLED
npl_freertos_funcs_deinit();
#endif
ble_transport_ll_deinit();
return ESP_OK;
}