Add option to allocate external RAM using heap_alloc_caps

This commit is contained in:
Jeroen Domburg
2017-09-05 17:29:57 +08:00
parent 538e9d83fc
commit 875ae6a134
12 changed files with 154 additions and 40 deletions

View File

@@ -180,7 +180,7 @@ void heap_caps_init()
heap_t *heaps_array = NULL;
for (int i = 0; i < num_heaps; i++) {
if (heap_caps_match(&temp_heaps[i], MALLOC_CAP_8BIT)) {
if (heap_caps_match(&temp_heaps[i], MALLOC_CAP_8BIT|MALLOC_CAP_INTERNAL)) {
/* use the first DRAM heap which can fit the data */
heaps_array = multi_heap_malloc(temp_heaps[i].heap, sizeof(heap_t) * num_heaps);
if (heaps_array != NULL) {