File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
ports/espressif/supervisor Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -304,18 +304,18 @@ void port_heap_init(void) {
304304}
305305
306306void * port_malloc (size_t size , bool dma_capable ) {
307- size_t caps = MALLOC_CAP_8BIT ;
308307 if (dma_capable ) {
309- caps |= MALLOC_CAP_DMA ;
308+ // SPIRAM is not DMA-capable, so don't bother to ask for it.
309+ return heap_caps_malloc (size , MALLOC_CAP_8BIT | MALLOC_CAP_DMA );
310310 }
311311
312312 void * ptr = NULL ;
313- // Try SPIRAM first when available.
313+ // Try SPIRAM first if available.
314314 #ifdef CONFIG_SPIRAM
315- ptr = heap_caps_malloc (size , caps | MALLOC_CAP_SPIRAM );
315+ ptr = heap_caps_malloc (size , MALLOC_CAP_8BIT | MALLOC_CAP_SPIRAM );
316316 #endif
317317 if (ptr == NULL ) {
318- ptr = heap_caps_malloc (size , caps );
318+ ptr = heap_caps_malloc (size , MALLOC_CAP_8BIT );
319319 }
320320 return ptr ;
321321}
You can’t perform that action at this time.
0 commit comments