mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-09 04:56:53 +03:00
Migration of PlatformIO 5.2.0 to 6.1.0 (resp. ESP IDF from 4.4.2 to 5.0.1) (#2305)
* Migration to PlatformIO 6.1.0 * Disable RMTMEM usage as it is no longer allowed -> Smart LEDs not functional! * moved miniz into subfolder of jomjol_fileserver_ota, else it does not build anymore. * cleanup * fix leading NaN (#2310) * Migration to PlatformIO 6.1.0 * Disable RMTMEM usage as it is no longer allowed -> Smart LEDs not functional! * moved miniz into subfolder of jomjol_fileserver_ota, else it does not build anymore. * cleanup * Task watchdog has new config name * Fix return value check. It must be something else than ESP_FAIL, but it does not need to be ESP_OK! * add missing strucures to work around new RMTMEM restriction (untested) --------- Co-authored-by: CaCO3 <caco@ruinelli.ch>
This commit is contained in:
@@ -9,10 +9,9 @@
|
||||
|
||||
//#include "driver/gpio.h"
|
||||
//#include "sdkconfig.h"
|
||||
//#include "esp_psram.h" // Comming in IDF 5.0, see https://docs.espressif.com/projects/esp-idf/en/v5.0-beta1/esp32/migration-guides/release-5.x/system.html?highlight=esp_psram_get_size
|
||||
//#include "spiram.h"
|
||||
#include "esp32/spiram.h"
|
||||
#include "esp_psram.h"
|
||||
#include "esp_pm.h"
|
||||
#include "esp_chip_info.h"
|
||||
|
||||
|
||||
// SD-Card ////////////////////
|
||||
@@ -63,6 +62,11 @@
|
||||
#endif
|
||||
#endif //DEBUG_ENABLE_SYSINFO
|
||||
|
||||
// define `gpio_pad_select_gpip` for newer versions of IDF
|
||||
#if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 3, 0))
|
||||
#include "esp_rom_gpio.h"
|
||||
#define gpio_pad_select_gpio esp_rom_gpio_pad_select_gpio
|
||||
#endif
|
||||
|
||||
#ifdef USE_HIMEM_IF_AVAILABLE
|
||||
#include "esp32/himem.h"
|
||||
@@ -372,14 +376,14 @@ extern "C" void app_main(void)
|
||||
|
||||
// Init external PSRAM
|
||||
// ********************************************
|
||||
esp_err_t PSRAMStatus = esp_spiram_init();
|
||||
if (PSRAMStatus != ESP_OK) { // ESP_FAIL -> Failed to init PSRAM
|
||||
esp_err_t PSRAMStatus = esp_psram_init();
|
||||
if (PSRAMStatus == ESP_FAIL) { // ESP_FAIL -> Failed to init PSRAM
|
||||
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "PSRAM init failed (" + std::to_string(PSRAMStatus) + ")! PSRAM not found or defective");
|
||||
setSystemStatusFlag(SYSTEM_STATUS_PSRAM_BAD);
|
||||
StatusLED(PSRAM_INIT, 1, true);
|
||||
}
|
||||
else { // ESP_OK -> PSRAM init OK --> continue to check PSRAM size
|
||||
size_t psram_size = esp_spiram_get_size(); // size_t psram_size = esp_psram_get_size(); // comming in IDF 5.0
|
||||
size_t psram_size = esp_psram_get_size(); // size_t psram_size = esp_psram_get_size(); // comming in IDF 5.0
|
||||
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "PSRAM size: " + std::to_string(psram_size) + " byte (" + std::to_string(psram_size/1024/1024) +
|
||||
"MB / " + std::to_string(psram_size/1024/1024*8) + "MBit)");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user