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) {
304
304
}
305
305
306
306
void * port_malloc (size_t size , bool dma_capable ) {
307
- size_t caps = MALLOC_CAP_8BIT ;
308
307
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 );
310
310
}
311
311
312
312
void * ptr = NULL ;
313
- // Try SPIRAM first when available.
313
+ // Try SPIRAM first if available.
314
314
#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 );
316
316
#endif
317
317
if (ptr == NULL ) {
318
- ptr = heap_caps_malloc (size , caps );
318
+ ptr = heap_caps_malloc (size , MALLOC_CAP_8BIT );
319
319
}
320
320
return ptr ;
321
321
}
You can’t perform that action at this time.
0 commit comments