add psram check for RMII workaround
This commit is contained in:
12
src/util/PSRAM.cpp
Normal file
12
src/util/PSRAM.cpp
Normal file
@@ -0,0 +1,12 @@
|
||||
#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
|
||||
}
|
||||
11
src/util/PSRAM.h
Normal file
11
src/util/PSRAM.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#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);
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user