Update PSRAM config params for IDF4+ (#5298)

This commit is contained in:
Keith Burzinski 2023-08-29 00:11:58 -05:00 committed by GitHub
parent b20bae23cc
commit c4adb30ab2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,6 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components.esp32 import add_idf_sdkconfig_option
from esphome.components.esp32 import add_idf_sdkconfig_option, get_esp32_variant
from esphome.core import CORE
from esphome.const import (
CONF_ID,
@ -21,7 +21,11 @@ async def to_code(config):
cg.add_build_flag("-DBOARD_HAS_PSRAM")
if CORE.using_esp_idf:
add_idf_sdkconfig_option("CONFIG_ESP32_SPIRAM_SUPPORT", True)
add_idf_sdkconfig_option(
f"CONFIG_{get_esp32_variant().upper()}_SPIRAM_SUPPORT", True
)
add_idf_sdkconfig_option("CONFIG_SPIRAM", True)
add_idf_sdkconfig_option("CONFIG_SPIRAM_USE", True)
add_idf_sdkconfig_option("CONFIG_SPIRAM_USE_CAPS_ALLOC", True)
add_idf_sdkconfig_option("CONFIG_SPIRAM_IGNORE_NOTFOUND", True)