From 2f612a20771af76bd7c3d11777d6a77f41f60a8e Mon Sep 17 00:00:00 2001 From: "Alan C. Assis" Date: Fri, 6 Nov 2020 10:05:26 -0300 Subject: [PATCH] xtensa/esp32: Move #if defined(SPIRAM) to inside function --- arch/xtensa/src/esp32/esp32_allocateheap.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/xtensa/src/esp32/esp32_allocateheap.c b/arch/xtensa/src/esp32/esp32_allocateheap.c index 41d1bee68f..efb57ec06f 100644 --- a/arch/xtensa/src/esp32/esp32_allocateheap.c +++ b/arch/xtensa/src/esp32/esp32_allocateheap.c @@ -93,13 +93,15 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) * ****************************************************************************/ -#if CONFIG_MM_REGIONS > 1 && defined(CONFIG_ESP32_SPIRAM) +#if CONFIG_MM_REGIONS > 1 void xtensa_add_region(void) { +#if defined(CONFIG_ESP32_SPIRAM) /* Check for any additional memory regions */ -#if defined(CONFIG_HEAP2_BASE) && defined(CONFIG_HEAP2_SIZE) - umm_addregion((FAR void *)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE); +# if defined(CONFIG_HEAP2_BASE) && defined(CONFIG_HEAP2_SIZE) + umm_addregion((FAR void *)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE); +# endif #endif } #endif