<commit_before>#
# Copyright (c) .NET Foundation and Contributors
# See LICENSE file in the project root for full license information.
#

include(FetchContent)
include(binutils.ESP32)

# Set target series in lower case
nf_set_esp32_target_series()

# option to reserve RAM for IDF allocator
option(ESP32_RESERVED_RAM_FOR_IDF_ALLOCATION "Reserved RAM for IDF allocation (in kBytes)")
if(NOT (ESP32_RESERVED_RAM_FOR_IDF_ALLOCATION EQUAL OFF))
    unset(ESP32_RESERVED_RAM_FOR_IDF_ALLOCATION CACHE)
    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)

# ESP32 targets use Espressif IDF and ESP32 FreeRTOS

# check if ESP32_IDF_PATH was specified or if it's empty (default is empty)
set(NO_ESP32_IDF_PATH TRUE)
if(ESP32_IDF_PATH)
    if(NOT "${ESP32_IDF_PATH}" STREQUAL "")
        set(NO_ESP32_IDF_PATH FALSE)
    endif()
endif()

# WHEN CHANGING THIS MAKE SURE TO UPDATE:
# 1. the dev containers
# 2. ref in AZDO pipeline yaml in Community Targets repo
set(ESP32_IDF_TAG "4.4.3" CACHE INTERNAL "ESP32 IDF tag")
<commit_msg>Fix setting reserving RAM for IDF allocation (#2467)<commit_after>#
# Copyright (c) .NET Foundation and Contributors
# See LICENSE file in the project root for full license information.
#

include(FetchContent)
include(binutils.ESP32)

# Set target series in lower case
nf_set_esp32_target_series()

# option to reserve RAM for IDF allocator
option(ESP32_RESERVED_RAM_FOR_IDF_ALLOCATION "Reserved RAM for IDF allocation (in kBytes)")

if(NOT ESP32_RESERVED_RAM_FOR_IDF_ALLOCATION)
    unset(ESP32_RESERVED_RAM_FOR_IDF_ALLOCATION CACHE)
    set(ESP32_RESERVED_RAM_FOR_IDF_ALLOCATION "0" CACHE STRING "Setting default value for ESP32_RESERVED_RAM_FOR_IDF_ALLOCATION")
endif()
message(STATUS "Reserved RAM for allocation by IDF: ${ESP32_RESERVED_RAM_FOR_IDF_ALLOCATION}k")

# 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)

# ESP32 targets use Espressif IDF and ESP32 FreeRTOS

# check if ESP32_IDF_PATH was specified or if it's empty (default is empty)
set(NO_ESP32_IDF_PATH TRUE)
if(ESP32_IDF_PATH)
    if(NOT "${ESP32_IDF_PATH}" STREQUAL "")
        set(NO_ESP32_IDF_PATH FALSE)
    endif()
endif()

# WHEN CHANGING THIS MAKE SURE TO UPDATE:
# 1. the dev containers
# 2. ref in AZDO pipeline yaml in Community Targets repo
set(ESP32_IDF_TAG "4.4.3" CACHE INTERNAL "ESP32 IDF tag")

{'fraction_non_alphanumeric': 0.06738623103850641, 'fraction_numerical': 0.03150525087514586, 'mean_word_length': 6.406047516198704, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1436772', 'n_tokens_mistral': 1354, 'n_tokens_neox': 1236, 'n_words': 339}