mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-05-22 01:27:11 +08:00
fix(heap): Fix heap initialize error when disable IRAM for heap
This commit is contained in:
@ -22,17 +22,18 @@ heap_region_t g_heap_region[HEAP_REGIONS_MAX];
|
||||
void heap_caps_init(void)
|
||||
{
|
||||
extern char _heap_start;
|
||||
extern char _lit4_end;
|
||||
|
||||
#ifndef CONFIG_SOC_FULL_ICACHE
|
||||
extern char _lit4_end;
|
||||
|
||||
g_heap_region[0].start_addr = (uint8_t *)&_lit4_end;
|
||||
g_heap_region[0].total_size = ((size_t)(0x4010C000 - (uint32_t)&_lit4_end));
|
||||
g_heap_region[0].caps = MALLOC_CAP_32BIT;
|
||||
#endif
|
||||
|
||||
g_heap_region[1].start_addr = (uint8_t *)&_heap_start;
|
||||
g_heap_region[1].total_size = ((size_t)(0x40000000 - (uint32_t)&_heap_start));
|
||||
g_heap_region[1].caps = MALLOC_CAP_8BIT | MALLOC_CAP_32BIT | MALLOC_CAP_DMA;
|
||||
g_heap_region[HEAP_REGIONS_MAX - 1].start_addr = (uint8_t *)&_heap_start;
|
||||
g_heap_region[HEAP_REGIONS_MAX - 1].total_size = ((size_t)(0x40000000 - (uint32_t)&_heap_start));
|
||||
g_heap_region[HEAP_REGIONS_MAX - 1].caps = MALLOC_CAP_8BIT | MALLOC_CAP_32BIT | MALLOC_CAP_DMA;
|
||||
|
||||
esp_heap_caps_init_region(g_heap_region, HEAP_REGIONS_MAX);
|
||||
}
|
||||
|
@ -18,6 +18,10 @@
|
||||
|
||||
#define HEAP_ALIGN_SIZE 4
|
||||
|
||||
#ifdef CONFIG_SOC_FULL_ICACHE
|
||||
#define HEAP_REGIONS_MAX 1
|
||||
#else
|
||||
#define HEAP_REGIONS_MAX 2
|
||||
#endif
|
||||
|
||||
#define MEM_BLK_MIN 1
|
||||
|
Reference in New Issue
Block a user