mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-01 06:27:29 +00:00
fix(rmt): fixed unstable transfer during DFS
Closes https://github.com/espressif/esp-idf/issues/12292
This commit is contained in:
@@ -250,8 +250,6 @@ esp_err_t rmt_new_tx_channel(const rmt_tx_channel_config_t *config, rmt_channel_
|
||||
rmt_hal_context_t *hal = &group->hal;
|
||||
int channel_id = tx_channel->base.channel_id;
|
||||
int group_id = group->group_id;
|
||||
// select the clock source
|
||||
ESP_GOTO_ON_ERROR(rmt_select_periph_clock(&tx_channel->base, config->clk_src), err, TAG, "set group clock failed");
|
||||
|
||||
// reset channel, make sure the TX engine is not working, and events are cleared
|
||||
portENTER_CRITICAL(&group->spinlock);
|
||||
@@ -277,6 +275,8 @@ esp_err_t rmt_new_tx_channel(const rmt_tx_channel_config_t *config, rmt_channel_
|
||||
ESP_GOTO_ON_ERROR(rmt_tx_init_dma_link(tx_channel, config), err, TAG, "install tx DMA failed");
|
||||
}
|
||||
#endif
|
||||
// select the clock source
|
||||
ESP_GOTO_ON_ERROR(rmt_select_periph_clock(&tx_channel->base, config->clk_src), err, TAG, "set group clock failed");
|
||||
// set channel clock resolution
|
||||
uint32_t real_div = group->resolution_hz / config->resolution_hz;
|
||||
rmt_ll_tx_set_channel_clock_div(hal->regs, channel_id, real_div);
|
||||
|
Reference in New Issue
Block a user