From e5b7e3039a8ffc19ad6d60b693ee037e6329e5cf Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Thu, 17 Apr 2025 17:04:43 +1200 Subject: [PATCH] Fix psram below idf 5 (#8584) --- esphome/components/psram/psram.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/esphome/components/psram/psram.cpp b/esphome/components/psram/psram.cpp index f592ada246..162543545e 100644 --- a/esphome/components/psram/psram.cpp +++ b/esphome/components/psram/psram.cpp @@ -1,7 +1,8 @@ #ifdef USE_ESP32 #include "psram.h" -#ifdef USE_ESP_IDF +#include +#if defined(USE_ESP_IDF) && ESP_IDF_VERSION_MAJOR >= 5 #include #endif // USE_ESP_IDF @@ -15,7 +16,7 @@ static const char *const TAG = "psram"; void PsramComponent::dump_config() { ESP_LOGCONFIG(TAG, "PSRAM:"); -#ifdef USE_ESP_IDF +#if defined(USE_ESP_IDF) && ESP_IDF_VERSION_MAJOR >= 5 bool available = esp_psram_is_initialized(); ESP_LOGCONFIG(TAG, " Available: %s", YESNO(available));