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 @@ -308,18 +308,18 @@ void port_heap_init(void) {
308308}
309309
310310void * port_malloc (size_t size , bool dma_capable ) {
311- size_t caps = MALLOC_CAP_8BIT ;
312311 if (dma_capable ) {
313- caps |= MALLOC_CAP_DMA ;
312+ // SPIRAM is not DMA-capable, so don't bother to ask for it.
313+ return heap_caps_malloc (size , MALLOC_CAP_8BIT | MALLOC_CAP_DMA );
314314 }
315315
316316 void * ptr = NULL ;
317- // Try SPIRAM first when available.
317+ // Try SPIRAM first if available.
318318 #ifdef CONFIG_SPIRAM
319- ptr = heap_caps_malloc (size , caps | MALLOC_CAP_SPIRAM );
319+ ptr = heap_caps_malloc (size , MALLOC_CAP_8BIT | MALLOC_CAP_SPIRAM );
320320 #endif
321321 if (ptr == NULL ) {
322- ptr = heap_caps_malloc (size , caps );
322+ ptr = heap_caps_malloc (size , MALLOC_CAP_8BIT );
323323 }
324324 return ptr ;
325325}
You can’t perform that action at this time.
0 commit comments