From 49b15c8306e93b7a359f5843f6cb2c5b821715da Mon Sep 17 00:00:00 2001 From: Erwan Gouriou Date: Wed, 2 Feb 2022 11:37:23 +0100 Subject: [PATCH] drivers/bluetooth/hci: stm32wb: Move RX thread creation to open In order to enable RX thread abortion on close, move creation to from init to open. Signed-off-by: Erwan Gouriou --- drivers/bluetooth/hci/ipm_stm32wb.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/bluetooth/hci/ipm_stm32wb.c b/drivers/bluetooth/hci/ipm_stm32wb.c index f6ee658476f..43c723591a3 100644 --- a/drivers/bluetooth/hci/ipm_stm32wb.c +++ b/drivers/bluetooth/hci/ipm_stm32wb.c @@ -530,6 +530,13 @@ static int bt_ipm_open(void) { int err; + /* Start RX thread */ + k_thread_create(&ipm_rx_thread_data, ipm_rx_stack, + K_KERNEL_STACK_SIZEOF(ipm_rx_stack), + (k_thread_entry_t)bt_ipm_rx_thread, NULL, NULL, NULL, + K_PRIO_COOP(CONFIG_BT_DRIVER_RX_HIGH_PRIO), + 0, K_NO_WAIT); + err = bt_ipm_ble_init(); if (err) { return err; @@ -556,13 +563,6 @@ static int _bt_ipm_init(const struct device *unused) start_ble_rf(); - /* Start RX thread */ - k_thread_create(&ipm_rx_thread_data, ipm_rx_stack, - K_KERNEL_STACK_SIZEOF(ipm_rx_stack), - (k_thread_entry_t)bt_ipm_rx_thread, NULL, NULL, NULL, - K_PRIO_COOP(CONFIG_BT_DRIVER_RX_HIGH_PRIO), - 0, K_NO_WAIT); - /* Take BLE out of reset */ ipcc_reset();