driver: bluetooth: hci: fix potential "block forever" issue
Interrupt is enabled before reset is released to make sure that the first IRQ edge is captured, and rx thread can process it. Remove delay in spi_open as it was redundant due to the "sem_initialised" semaphore. Signed-off-by: Ali Hozhabri <ali.hozhabri@st.com>
This commit is contained in:
parent
ef1f6417ff
commit
be5cf2ddb9
1 changed files with 3 additions and 5 deletions
|
@ -287,8 +287,6 @@ static void bt_spi_rx_thread(void)
|
|||
int len;
|
||||
|
||||
(void)memset(&txmsg, 0xFF, SPI_MAX_MSG_LEN);
|
||||
/* Enable the interrupt line */
|
||||
gpio_pin_interrupt_configure_dt(&irq_gpio, GPIO_INT_EDGE_TO_ACTIVE);
|
||||
while (true) {
|
||||
|
||||
/* Wait for interrupt pin to be active */
|
||||
|
@ -497,13 +495,13 @@ static int bt_spi_open(void)
|
|||
return err;
|
||||
}
|
||||
|
||||
/* Enable the interrupt line */
|
||||
gpio_pin_interrupt_configure_dt(&irq_gpio, GPIO_INT_EDGE_TO_ACTIVE);
|
||||
|
||||
/* Take BLE out of reset */
|
||||
k_sleep(K_MSEC(DT_INST_PROP_OR(0, reset_assert_duration_ms, 0)));
|
||||
gpio_pin_set_dt(&rst_gpio, 0);
|
||||
|
||||
/* Give the controller some time to boot */
|
||||
k_sleep(K_MSEC(1));
|
||||
|
||||
/* Start RX thread */
|
||||
k_thread_create(&spi_rx_thread_data, spi_rx_stack,
|
||||
K_KERNEL_STACK_SIZEOF(spi_rx_stack),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue