You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ag...@apache.org on 2020/11/06 15:20:01 UTC

[incubator-nuttx] 03/03: xtensa/esp32: Move #if defined(SPIRAM) to inside function

This is an automated email from the ASF dual-hosted git repository.

aguettouche pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 2f612a20771af76bd7c3d11777d6a77f41f60a8e
Author: Alan C. Assis <ac...@gmail.com>
AuthorDate: Fri Nov 6 10:05:26 2020 -0300

    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 41d1bee..efb57ec 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