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