mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix(spi): fixed undesired touching to DMA
Closes https://github.com/espressif/esp-idf/issues/12241
This commit is contained in:
parent
2bab3b36bc
commit
94a8591586
@ -61,7 +61,9 @@ void spi_hal_init(spi_hal_context_t *hal, uint32_t host_id, const spi_hal_config
|
|||||||
hal->dmadesc_n = config->dmadesc_n;
|
hal->dmadesc_n = config->dmadesc_n;
|
||||||
|
|
||||||
spi_ll_master_init(hw);
|
spi_ll_master_init(hw);
|
||||||
|
if (config->dma_enabled) {
|
||||||
s_spi_hal_dma_init_config(hal);
|
s_spi_hal_dma_init_config(hal);
|
||||||
|
}
|
||||||
|
|
||||||
//Force a transaction done interrupt. This interrupt won't fire yet because
|
//Force a transaction done interrupt. This interrupt won't fire yet because
|
||||||
//we initialized the SPI interrupt as disabled. This way, we can just
|
//we initialized the SPI interrupt as disabled. This way, we can just
|
||||||
|
@ -31,7 +31,9 @@ void spi_slave_hal_init(spi_slave_hal_context_t *hal, const spi_slave_hal_config
|
|||||||
hal->dma_in = hal_config->dma_in;
|
hal->dma_in = hal_config->dma_in;
|
||||||
hal->dma_out = hal_config->dma_out;
|
hal->dma_out = hal_config->dma_out;
|
||||||
|
|
||||||
|
if (hal->use_dma) {
|
||||||
s_spi_slave_hal_dma_init_config(hal);
|
s_spi_slave_hal_dma_init_config(hal);
|
||||||
|
}
|
||||||
spi_ll_slave_init(hal->hw);
|
spi_ll_slave_init(hal->hw);
|
||||||
|
|
||||||
//Force a transaction done interrupt. This interrupt won't fire yet because we initialized the SPI interrupt as
|
//Force a transaction done interrupt. This interrupt won't fire yet because we initialized the SPI interrupt as
|
||||||
|
@ -78,7 +78,9 @@ void spi_slave_hd_hal_init(spi_slave_hd_hal_context_t *hal, const spi_slave_hd_h
|
|||||||
hal->rx_dma_head = &hal->rx_dummy_head;
|
hal->rx_dma_head = &hal->rx_dummy_head;
|
||||||
|
|
||||||
//Configure slave
|
//Configure slave
|
||||||
|
if (hal_config->dma_enabled) {
|
||||||
s_spi_slave_hd_hal_dma_init_config(hal);
|
s_spi_slave_hd_hal_dma_init_config(hal);
|
||||||
|
}
|
||||||
|
|
||||||
spi_ll_slave_hd_init(hw);
|
spi_ll_slave_hd_init(hw);
|
||||||
spi_ll_set_addr_bitlen(hw, hal_config->address_bits);
|
spi_ll_set_addr_bitlen(hw, hal_config->address_bits);
|
||||||
|
Loading…
Reference in New Issue
Block a user