Merge pull request from kroimon/guard_gdma_config_transfer

Guard new gdma_config_transfer to allow building with ESP-IDF < 5.4.0
This commit is contained in:
mrcodetastic 2025-01-14 21:13:05 +00:00 committed by GitHub
commit 99131abc83
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 1 deletions

View file

@ -140,6 +140,7 @@ bool Bus_Parallel16::init(void)
.auto_update_desc = false};
gdma_apply_strategy(dma_chan, &strategy_config);
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
gdma_transfer_config_t transfer_config = {
#ifdef SPIRAM_DMA_BUFFER
.max_data_burst_size = 64,
@ -150,6 +151,13 @@ bool Bus_Parallel16::init(void)
#endif
};
gdma_config_transfer(dma_chan, &transfer_config);
#else
gdma_transfer_ability_t ability = {
.sram_trans_align = 32,
.psram_trans_align = 64,
};
gdma_set_transfer_ability(dma_chan, &ability);
#endif
// Enable DMA transfer callback
static gdma_tx_event_callbacks_t tx_cbs = {

View file

@ -256,6 +256,7 @@
};
gdma_apply_strategy(dma_chan, &strategy_config);
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
gdma_transfer_config_t transfer_config = {
#ifdef SPIRAM_DMA_BUFFER
.max_data_burst_size = 64,
@ -265,7 +266,14 @@
.access_ext_mem = false
#endif
};
gdma_config_transfer(dma_chan, &transfer_config);
gdma_config_transfer(dma_chan, &transfer_config);
#else
gdma_transfer_ability_t ability = {
.sram_trans_align = 32,
.psram_trans_align = 64,
};
gdma_set_transfer_ability(dma_chan, &ability);
#endif
// Enable DMA transfer callback
static gdma_tx_event_callbacks_t tx_cbs = {