Skip to content

Commit aa6fc26

Browse files
committed
Guard new gdma_config_transfer to allow building with ESP-IDF < 5.4.0
1 parent 87518f9 commit aa6fc26

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/platforms/esp32c6/dma_parallel_io.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ bool Bus_Parallel16::init(void)
140140
.auto_update_desc = false};
141141
gdma_apply_strategy(dma_chan, &strategy_config);
142142

143+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
143144
gdma_transfer_config_t transfer_config = {
144145
#ifdef SPIRAM_DMA_BUFFER
145146
.max_data_burst_size = 64,
@@ -150,6 +151,13 @@ bool Bus_Parallel16::init(void)
150151
#endif
151152
};
152153
gdma_config_transfer(dma_chan, &transfer_config);
154+
#else
155+
gdma_transfer_ability_t ability = {
156+
.sram_trans_align = 32,
157+
.psram_trans_align = 64,
158+
};
159+
gdma_set_transfer_ability(dma_chan, &ability);
160+
#endif
153161

154162
// Enable DMA transfer callback
155163
static gdma_tx_event_callbacks_t tx_cbs = {

src/platforms/esp32s3/gdma_lcd_parallel16.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@
256256
};
257257
gdma_apply_strategy(dma_chan, &strategy_config);
258258

259+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
259260
gdma_transfer_config_t transfer_config = {
260261
#ifdef SPIRAM_DMA_BUFFER
261262
.max_data_burst_size = 64,
@@ -265,7 +266,14 @@
265266
.access_ext_mem = false
266267
#endif
267268
};
268-
gdma_config_transfer(dma_chan, &transfer_config);
269+
gdma_config_transfer(dma_chan, &transfer_config);
270+
#else
271+
gdma_transfer_ability_t ability = {
272+
.sram_trans_align = 32,
273+
.psram_trans_align = 64,
274+
};
275+
gdma_set_transfer_ability(dma_chan, &ability);
276+
#endif
269277

270278
// Enable DMA transfer callback
271279
static gdma_tx_event_callbacks_t tx_cbs = {

0 commit comments

Comments
 (0)