diff --git a/clion/CMakeLists.txt b/clion/CMakeLists.txt index 26640d66..ad9ddb50 100644 --- a/clion/CMakeLists.txt +++ b/clion/CMakeLists.txt @@ -54,8 +54,6 @@ set(SRCFILES ../src/NukiOfficial.cpp ../src/NukiPublisher.cpp ../src/EspMillis.h - ../src/util/PSRAM.cpp - ../src/util/PSRAM.h ) file(GLOB_RECURSE SRCFILESREC diff --git a/src/networkDevices/EthernetDevice.cpp b/src/networkDevices/EthernetDevice.cpp index bf497ff4..c1163f9e 100644 --- a/src/networkDevices/EthernetDevice.cpp +++ b/src/networkDevices/EthernetDevice.cpp @@ -6,9 +6,9 @@ #ifdef CONFIG_IDF_TARGET_ESP32 #include "esp_private/esp_gpio_reserve.h" -#include "util/PSRAM.h" #include - +#include "esp_psram.h" +#include "esp32-hal.h" #endif extern bool ethCriticalFailure; @@ -101,7 +101,7 @@ void EthernetDevice::initialize() // https://github.com/arendst/Tasmota/commit/f8fbe153000591727e40b5007e0de78c33833131 // https://github.com/arendst/Tasmota/commit/f8fbe153000591727e40b5007e0de78c33833131#diff-32fc0eefbf488dd507b3bef52189bbe37158737aba6f96fe98a8746dc5021955R417 uint32_t pkg_version = bootloader_common_get_chip_ver_pkg(); - if(PSRAM::found && pkg_version <= 3) + if(esp_psram_get_size() <= 0 && pkg_version <= 3) { esp_gpio_revoke(0xFFFFFFFFFFFFFFFF); } diff --git a/src/util/PSRAM.cpp b/src/util/PSRAM.cpp deleted file mode 100644 index 1b97be3d..00000000 --- a/src/util/PSRAM.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include "esp_psram.h" -#include "esp32-hal.h" -#include "PSRAM.h" - -const bool PSRAM::found(void) -{ -#if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || DISABLE_PSRAMCHECK || CORE32SOLO1 - return psramFound(); -#else - return psramFound() && esp_psram_is_initialized(); -#endif -} diff --git a/src/util/PSRAM.h b/src/util/PSRAM.h deleted file mode 100644 index 356c3fb2..00000000 --- a/src/util/PSRAM.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -class PSRAM -{ - public: - // this function is a replacement for `psramFound()`. -// `psramFound()` can return true even if no PSRAM is actually installed -// This new version also checks `esp_spiram_is_initialized` to know if the PSRAM is initialized - static const bool found(void); - -};