Bluetooth: SPI: Disable IRQ pin callback to avoid spurious IRQs
Avoid spurious IRQ when already handling the SPI Slave IRQ. Change-Id: If8452a668bc9768d462a5fa56b851e99a076e67c Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
This commit is contained in:
parent
2569e2e8d1
commit
a3474a731e
1 changed files with 3 additions and 0 deletions
|
@ -142,6 +142,8 @@ static void bt_spi_rx_thread(void)
|
|||
|
||||
while (true) {
|
||||
k_sem_take(&sem_request, K_FOREVER);
|
||||
/* Disable IRQ pin callback to avoid spurious IRQs */
|
||||
gpio_pin_disable_callback(irq_dev, GPIO_IRQ_PIN);
|
||||
k_sem_take(&sem_busy, K_FOREVER);
|
||||
|
||||
do {
|
||||
|
@ -159,6 +161,7 @@ static void bt_spi_rx_thread(void)
|
|||
spi_transceive(spi_dev, &txmsg, size, &rxmsg, size);
|
||||
} while (rxmsg[0] == 0);
|
||||
|
||||
gpio_pin_enable_callback(irq_dev, GPIO_IRQ_PIN);
|
||||
#if defined(CONFIG_BLUETOOTH_SPI_BLUENRG)
|
||||
gpio_pin_write(cs_dev, GPIO_CS_PIN, 1);
|
||||
#endif /* CONFIG_BLUETOOTH_SPI_BLUENRG */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue