esp32_allocateheap.c: Remove the amount reserved to himem from the heap.

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
This commit is contained in:
Abdelatif Guettouche 2021-07-19 19:36:01 +02:00 committed by Xiang Xiao
parent 8660572a3c
commit 315ba8c77f

View File

@ -34,6 +34,11 @@
#include <arch/board/board.h>
#include <arch/esp32/memory_layout.h>
#ifdef CONFIG_ESP32_SPIRAM_BANKSWITCH_ENABLE
#include <nuttx/himem/himem.h>
#include "esp32_himem.h"
#endif
#include "xtensa.h"
/****************************************************************************
@ -143,6 +148,9 @@ void xtensa_add_region(void)
start = (FAR void *)CONFIG_HEAP2_BASE;
size = CONFIG_HEAP2_SIZE;
# endif
# ifdef CONFIG_ESP32_SPIRAM_BANKSWITCH_ENABLE
size -= esp_himem_reserved_area_size();
# endif
umm_addregion(start, size);
# endif
#endif