Merge branch 'bugfix/fix_spiram_cap_doesnt_match_with_dma_cap_issue' into 'master'

dma: fixed spiram_cap doesn't match with dma cap issue for esp_dma_malloc

See merge request espressif/esp-idf!30231
pull/13517/merge
Armando (Dou Yiwen) 2024-04-15 14:59:43 +08:00
commit f5a00d7c9b
1 zmienionych plików z 5 dodań i 0 usunięć

Wyświetl plik

@ -40,6 +40,11 @@ esp_err_t esp_dma_capable_malloc(size_t size, const esp_dma_mem_info_t *dma_mem_
if (dma_mem_info->extra_heap_caps & MALLOC_CAP_SPIRAM) {
cache_flags |= ESP_DMA_MALLOC_FLAG_PSRAM;
heap_caps = dma_mem_info->extra_heap_caps | MALLOC_CAP_SPIRAM;
/**
* This is a workaround because we don't have `MALLOC_CAP_DMA | MALLOC_CAP_SPIRAM`
* match when using heap_cap related allocations.
*/
heap_caps &= ~MALLOC_CAP_DMA;
}
esp_err_t ret = esp_cache_get_alignment(cache_flags, &cache_alignment_bytes);