mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-08-30 13:50:03 +00:00
fix(nimble): De-register host cb in stack deinit
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user