|
|
@@ -1,5 +1,5 @@
|
|
|
/*
|
|
|
- * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
|
|
|
+ * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
|
|
*
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
*/
|
|
|
@@ -1042,10 +1042,13 @@ esp_err_t SPI_MASTER_ISR_ATTR spi_device_polling_start(spi_device_handle_t handl
|
|
|
if (ret!=ESP_OK) return ret;
|
|
|
SPI_CHECK(!spi_bus_device_is_polling(handle), "Cannot send polling transaction while the previous polling transaction is not terminated.", ESP_ERR_INVALID_STATE );
|
|
|
|
|
|
+ spi_host_t *host = handle->host;
|
|
|
+ ret = setup_priv_desc(trans_desc, &host->cur_trans_buf, (host->bus_attr->dma_enabled));
|
|
|
+ if (ret!=ESP_OK) return ret;
|
|
|
+
|
|
|
/* If device_acquiring_lock is set to handle, it means that the user has already
|
|
|
* acquired the bus thanks to the function `spi_device_acquire_bus()`.
|
|
|
* In that case, we don't need to take the lock again. */
|
|
|
- spi_host_t *host = handle->host;
|
|
|
if (host->device_acquiring_lock != handle) {
|
|
|
/* The user cannot ask for the CS to keep active has the bus is not locked/acquired. */
|
|
|
if ((trans_desc->flags & SPI_TRANS_CS_KEEP_ACTIVE) != 0) {
|
|
|
@@ -1058,9 +1061,6 @@ esp_err_t SPI_MASTER_ISR_ATTR spi_device_polling_start(spi_device_handle_t handl
|
|
|
}
|
|
|
if (ret != ESP_OK) return ret;
|
|
|
|
|
|
- ret = setup_priv_desc(trans_desc, &host->cur_trans_buf, (host->bus_attr->dma_enabled));
|
|
|
- if (ret!=ESP_OK) return ret;
|
|
|
-
|
|
|
//Polling, no interrupt is used.
|
|
|
host->polling = true;
|
|
|
|