From 15d699cd704873bed9405cc092ca5379fea95f89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Mon, 14 Nov 2022 10:58:09 +0000 Subject: [PATCH] Add handling for non existing ESP32_SPIRAM_FOR_IDF_ALLOCATION build option --- targets/ESP32/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/targets/ESP32/CMakeLists.txt b/targets/ESP32/CMakeLists.txt index 2d77c4b7aa..5df82c3d3e 100644 --- a/targets/ESP32/CMakeLists.txt +++ b/targets/ESP32/CMakeLists.txt @@ -16,6 +16,15 @@ if(NOT (ESP32_RESERVED_RAM_FOR_IDF_ALLOCATION EQUAL OFF)) set(ESP32_RESERVED_RAM_FOR_IDF_ALLOCATION "0" CACHE STRING "Setting default value for ESP32_RESERVED_RAM_FOR_IDF_ALLOCATION") endif() +# option to reserve SPI RAM for IDF allocator +option(ESP32_SPIRAM_FOR_IDF_ALLOCATION "Reserved SPI RAM for IDF allocation (in kBytes)") + +if(NOT ESP32_SPIRAM_FOR_IDF_ALLOCATION) + unset(ESP32_SPIRAM_FOR_IDF_ALLOCATION CACHE) + set(ESP32_SPIRAM_FOR_IDF_ALLOCATION "0" CACHE STRING "Setting default value for ESP32_SPIRAM_FOR_IDF_ALLOCATION") +endif() +message(STATUS "Reserved SPI RAM for allocation by IDF: ${ESP32_SPIRAM_FOR_IDF_ALLOCATION}k") + # Define PLATFORM base path set(BASE_PATH_FOR_PLATFORM ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE)