File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -69,8 +69,12 @@ spi_bus_handle_t spi_bus_create(spi_host_device_t host_id, const spi_config_t *b
69
69
.quadhd_io_num = -1 ,
70
70
.max_transfer_sz = bus_conf -> max_transfer_sz ,
71
71
};
72
+ #if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL (4 , 3 , 0 ))
73
+ esp_err_t ret = spi_bus_initialize (host_id , & buscfg , SPI_DMA_CH_AUTO );
74
+ #else
72
75
int dma_chan = host_id ; //set dma channel equals to host_id by default
73
76
esp_err_t ret = spi_bus_initialize (host_id , & buscfg , dma_chan );
77
+ #endif
74
78
SPI_BUS_CHECK (ESP_OK == ret , "spi bus create failed" , NULL );
75
79
s_spi_bus [index ].host_id = host_id ;
76
80
memcpy (& s_spi_bus [index ].conf , & buscfg , sizeof (spi_bus_config_t ));
@@ -199,7 +203,7 @@ esp_err_t spi_bus_transfer_bytes(spi_bus_device_handle_t dev_handle, const uint8
199
203
return ESP_OK ;
200
204
}
201
205
202
- /**************************************** Public Functions (Low level)*********************************************/
206
+ /**************************************** Public Functions (Low level)*********************************************/
203
207
204
208
esp_err_t spi_bus_transmit_begin (spi_bus_device_handle_t dev_handle , spi_transaction_t * p_trans )
205
209
{
You can’t perform that action at this time.
0 commit comments