diff --git a/components/driver/include/driver/spi_master.h b/components/driver/include/driver/spi_master.h index 3c599ae9e0..16c9e26e79 100644 --- a/components/driver/include/driver/spi_master.h +++ b/components/driver/include/driver/spi_master.h @@ -43,7 +43,7 @@ extern "C" */ #define SPI_DEVICE_NO_DUMMY (1<<6) #define SPI_DEVICE_DDRCLK (1<<7) - +#define SPI_DEVICE_NO_RETURN_RESULT (1<<8) ///< Don't return the descriptor to the host on completion (use post_cb to notify instead) typedef struct spi_transaction_t spi_transaction_t; typedef void(*transaction_cb_t)(spi_transaction_t *trans); diff --git a/components/driver/spi_master.c b/components/driver/spi_master.c index 0a7cac3523..c6f9d5004c 100644 --- a/components/driver/spi_master.c +++ b/components/driver/spi_master.c @@ -612,9 +612,13 @@ static void SPI_MASTER_ISR_ATTR spi_intr(void *arg) //cur_cs is changed to DEV_NUM_MAX here spi_post_trans(host); + + if (!(host->device[cs]->cfg.flags & SPI_DEVICE_NO_RETURN_RESULT)) { + //Return transaction descriptor. + xQueueSendFromISR(host->device[cs]->ret_queue, &host->cur_trans_buf, &do_yield); + } + // spi_bus_lock_bg_pause(bus_attr->lock); - //Return transaction descriptor. - xQueueSendFromISR(host->device[cs]->ret_queue, &host->cur_trans_buf, &do_yield); #ifdef CONFIG_PM_ENABLE //Release APB frequency lock esp_pm_lock_release(bus_attr->pm_lock);