Skip to content

Commit 234e980

Browse files
committed
esp32_rmt: Use RMT DMA if available. Add INFO messages
Signed-off-by: Rick Sorensen <[email protected]>
1 parent 487f665 commit 234e980

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

ports/esp32/esp32_rmt.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,24 @@ static mp_obj_t esp32_rmt_make_new(const mp_obj_type_t *type, size_t n_args, siz
111111
self->tx_ongoing = 0;
112112
self->idle_level = idle_level;
113113
self->enabled = false;
114+
// NOTE:
115+
// s3/p4 support DMA (.flags.with_dma =1), others do not
116+
// see SOC_RMT_SUPPORT_DMA
114117

115118
rmt_tx_channel_config_t tx_chan_config = {
116119
.clk_src = RMT_CLK_SRC_DEFAULT,
117120
.gpio_num = self->pin,
118-
.mem_block_symbols = num_symbols,
119121
.resolution_hz = APB_CLK_FREQ / clock_div,
120122
.trans_queue_depth = 4,
123+
#if SOC_RMT_SUPPORT_DMA
124+
#warning "INFO: esp32_rmt.c: RMT using DMA"
125+
.mem_block_symbols = num_symbols,
126+
.flags.with_dma = 1,
127+
#else
128+
#warning "INFO: esp32_rmt.c: RMT not using DMA"
129+
.mem_block_symbols = num_symbols,
130+
.flags.with_dma = 0,
131+
#endif
121132
};
122133

123134
check_esp_err(rmt_new_tx_channel(&tx_chan_config, &self->channel));

0 commit comments

Comments
 (0)