forked from espressif/esp-idf
Merge branch 'bugfix/rmt_buffer_allocation' into 'master'
legacy rmt driver: fix wrong buffer allocation See merge request espressif/esp-idf!22367
This commit is contained in:
@@ -1184,12 +1184,12 @@ esp_err_t rmt_translator_init(rmt_channel_t channel, sample_to_rmt_t fn)
|
|||||||
const uint32_t block_size = mem_blocks * RMT_MEM_ITEM_NUM * sizeof(rmt_item32_t);
|
const uint32_t block_size = mem_blocks * RMT_MEM_ITEM_NUM * sizeof(rmt_item32_t);
|
||||||
if (p_rmt_obj[channel]->tx_buf == NULL) {
|
if (p_rmt_obj[channel]->tx_buf == NULL) {
|
||||||
#if !CONFIG_SPIRAM_USE_MALLOC
|
#if !CONFIG_SPIRAM_USE_MALLOC
|
||||||
p_rmt_obj[channel]->tx_buf = (rmt_item32_t *)malloc(block_size);
|
p_rmt_obj[channel]->tx_buf = (rmt_item32_t *)calloc(1, block_size);
|
||||||
#else
|
#else
|
||||||
if (p_rmt_obj[channel]->intr_alloc_flags & ESP_INTR_FLAG_IRAM) {
|
if (p_rmt_obj[channel]->intr_alloc_flags & ESP_INTR_FLAG_IRAM) {
|
||||||
p_rmt_obj[channel]->tx_buf = (rmt_item32_t *)malloc(block_size);
|
|
||||||
} else {
|
|
||||||
p_rmt_obj[channel]->tx_buf = (rmt_item32_t *)heap_caps_calloc(1, block_size, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
|
p_rmt_obj[channel]->tx_buf = (rmt_item32_t *)heap_caps_calloc(1, block_size, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
|
||||||
|
} else {
|
||||||
|
p_rmt_obj[channel]->tx_buf = (rmt_item32_t *)calloc(1, block_size);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (p_rmt_obj[channel]->tx_buf == NULL) {
|
if (p_rmt_obj[channel]->tx_buf == NULL) {
|
||||||
|
@@ -611,7 +611,8 @@ static esp_err_t i2s_lcd_select_periph_clock(esp_lcd_i80_bus_handle_t bus, lcd_c
|
|||||||
ESP_RETURN_ON_ERROR(clk_tree_src_get_freq_hz((soc_module_clk_t)src, CLK_TREE_SRC_FREQ_PRECISION_CACHED, &src_clk_hz),
|
ESP_RETURN_ON_ERROR(clk_tree_src_get_freq_hz((soc_module_clk_t)src, CLK_TREE_SRC_FREQ_PRECISION_CACHED, &src_clk_hz),
|
||||||
TAG, "get clock source frequency failed");
|
TAG, "get clock source frequency failed");
|
||||||
|
|
||||||
i2s_ll_tx_clk_set_src(bus->hal.dev, I2S_CLK_SRC_PLL_160M);
|
// I2S clock source is binary compatible with lcd_clock_source_t
|
||||||
|
i2s_ll_tx_clk_set_src(bus->hal.dev, (i2s_clock_src_t)src);
|
||||||
i2s_ll_set_raw_mclk_div(bus->hal.dev, LCD_PERIPH_CLOCK_PRE_SCALE, 1, 0);
|
i2s_ll_set_raw_mclk_div(bus->hal.dev, LCD_PERIPH_CLOCK_PRE_SCALE, 1, 0);
|
||||||
// save the resolution of the i80 bus
|
// save the resolution of the i80 bus
|
||||||
bus->resolution_hz = src_clk_hz / LCD_PERIPH_CLOCK_PRE_SCALE;
|
bus->resolution_hz = src_clk_hz / LCD_PERIPH_CLOCK_PRE_SCALE;
|
||||||
|
Reference in New Issue
Block a user