Merge branch 'bugfix/fix_legacy_adc_continuous_driver_dma_descriptor_not_internal_issue_v5.1' into 'release/v5.1'

adc: fixed legacy adc continuous driver dma descriptor not in internal ram issue (v5.1)

See merge request espressif/esp-idf!25508
This commit is contained in:
morris 2023-08-25 10:38:09 +08:00
commit 9080a7ac7c

View File

@ -209,7 +209,7 @@ esp_err_t adc_digi_initialize(const adc_digi_init_config_t *init_config)
//malloc dma descriptor
uint32_t dma_desc_num_per_frame = (init_config->conv_num_each_intr + DMA_DESCRIPTOR_BUFFER_MAX_SIZE_4B_ALIGNED - 1) / DMA_DESCRIPTOR_BUFFER_MAX_SIZE_4B_ALIGNED;
uint32_t dma_desc_max_num = dma_desc_num_per_frame * INTERNAL_BUF_NUM;
s_adc_digi_ctx->hal.rx_desc = heap_caps_calloc(1, (sizeof(dma_descriptor_t)) * dma_desc_max_num, MALLOC_CAP_DMA);
s_adc_digi_ctx->hal.rx_desc = heap_caps_calloc(1, (sizeof(dma_descriptor_t)) * dma_desc_max_num, MALLOC_CAP_INTERNAL | MALLOC_CAP_DMA);
if (!s_adc_digi_ctx->hal.rx_desc) {
ret = ESP_ERR_NO_MEM;
goto cleanup;