fix(spi): fixed undesired touching to DMA

Closes https://github.com/espressif/esp-idf/issues/12241
This commit is contained in:
Xiao Xufeng 2023-10-24 02:52:51 +08:00
parent b6a66b7d8c
commit 653008f4c7
3 changed files with 9 additions and 3 deletions

View File

@ -61,7 +61,9 @@ void spi_hal_init(spi_hal_context_t *hal, uint32_t host_id, const spi_hal_config
spi_ll_set_mosi_free_level(hw, 0); spi_ll_set_mosi_free_level(hw, 0);
#endif #endif
spi_ll_master_init(hw); spi_ll_master_init(hw);
s_spi_hal_dma_init_config(hal); if (config->dma_enabled) {
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

View File

@ -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;
s_spi_slave_hal_dma_init_config(hal); if (hal->use_dma) {
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

View File

@ -71,7 +71,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
s_spi_slave_hd_hal_dma_init_config(hal); if (hal_config->dma_enabled) {
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);