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:
Ricardo Salveti 2017-01-25 23:24:28 -02:00 committed by Johan Hedberg
commit a3474a731e

View file

@ -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 */