Skip to content

Commit

Permalink
Merge branch 'bugfix/spi_master_fifo_use_dma_v5.1' into 'release/v5.1'
Browse files Browse the repository at this point in the history
fix(spi): fixed undesired touching to DMA (v5.1)

See merge request espressif/esp-idf!26769
  • Loading branch information
jack0c committed Nov 14, 2023
2 parents 894cf04 + 653008f commit 93a6cb9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion components/hal/spi_hal.c
Expand Up @@ -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);
#endif
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
//we initialized the SPI interrupt as disabled. This way, we can just
Expand Down
4 changes: 3 additions & 1 deletion components/hal/spi_slave_hal.c
Expand Up @@ -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_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);

//Force a transaction done interrupt. This interrupt won't fire yet because we initialized the SPI interrupt as
Expand Down
4 changes: 3 additions & 1 deletion components/hal/spi_slave_hd_hal.c
Expand Up @@ -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;

//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_set_addr_bitlen(hw, hal_config->address_bits);
Expand Down

0 comments on commit 93a6cb9

Please sign in to comment.